-
Hi :) In #1374 the What happens if What I'd like to achieve is to support two different build systems, both relying on CMake. One for testing, the other for building the code. root The "test root" CmakeLists.txt does not include the one in build-src. I'd like to handle these completely independent and add two cmake config and build presets. Is that possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When We just happen to support a similarly named variable for consistency when resolving settings (most notably for For your project layout, it seems to me that you could set "cmake.sourceDirectory": [
"${workspaceFolder}",
"${workspaceFolder}/build-src"
] |
Beta Was this translation helpful? Give feedback.
When
${sourceDir}
is used in CMakePresets.json, it refers to the path to the project's source directory (e.g. CMAKE_SOURCE_DIR). Reference: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#macro-expansionWe just happen to support a similarly named variable for consistency when resolving settings (most notably for
cmake.buildDirectory
) because using${workspaceRoot}
could result in path collisions when generating multiple projects in the same folder. You can use${sourceDir}
and${sourceDirectory}
interchangeably.For your project layout, it seems to me that you could set
cmake.sourceDirectory
to the two root CMakeLists.txt that you have and the extension should allow you t…