Repository navigation
demos/distrib: Generate CMake presets for the demos in the release package - #439
KonradBreitsprecherBkd wants to merge 3 commits into
Conversation
…lKit-Demos based on the build arch Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
|
I tested this on Windows with packages built from this branch (
So the presets fix Visual Studio, and VS Code as long as it starts without a developer env. When a developer env is already loaded, VS Code ignores the preset's Should we document that in docs/demos/build.rst and or in the commit message? |
- Use MSVC instead of WIN32 to choose the Windows presets, since WIN32 also matches MinGW, which gets the Unix Makefiles presets instead. - Lower the presets version to 2, which already supports buildPresets and the "external" architecture strategy. - Install *.json.in files with the SilKit-Source package, so that CMakePresets.json.in is available when building from the source package. - docs/demos/build.rst: document the presets for VS Code. Known limitation with VS Code on Windows: the CMake Tools extension (cmake.useVsDeveloperEnvironment: "auto") only loads the developer environment for the preset's architecture if neither cl nor ninja is found. If a developer environment for another architecture is already loaded, the preset's architecture is ignored and configuring a 32-bit package fails because the 32-bit SilKitConfig.cmake is not accepted. Close all VS Code windows (VS Code reuses one process), delete the build folder and start VS Code without a developer environment, or from one that matches the package. Visual Studio is not affected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
The
SilKit-Demosfolder of a release package now contains a generatedCMakePresets.jsonthat only offers presets for the package's architecture:x64-release/x64-debugorx86-release/x86-debug(Ninja,architecturestrategyexternal)release/debug(Unix Makefiles)Without it, Visual Studio ("Open Folder") or VS Code could configure a 32-bit build for a 64-bit SIL Kit package.
Changes
Demos/CMakePresets.json.in: new presets template. It is left out of the plain demo install.SilKit/cmake/SilKitDemoPresets.cmake: newsilkit_install_demo_presets(), which detects the platform, configures the template and installs it toCMakeLists.txt: calls it in theSILKIT_INSTALL_SOURCEblock.docs/demos/build.rstexplains how to use the presets in Visual Studio and on the command line, and the changelog has a new entry.