Is it possible to set URL option for FetchContent_Declare() using a CMake variable?
I would like to define a CMake (v3.30.2) function that uses FetchContent_Declare()
and FetchContent_MakeAvailable()
to download some artifact from my GitLab instance.
CMake Custom Target Configuration Allow Differing Outputs Without Rebuild
I have a custom target for my CMake file that is configurable in the number of output files it produces. If the caller passes a particular argument to my script, I want to generate more output files. The issue that I am struggling to resolve is that if the user doesn’t pass in the argument to generate more files, and the inputs haven’t changed, I want the target to be skipped.
CMake find python cannot find numpy
I am writing a Cmake file and want to detect the version of numpy installed.
cmake CMAKE_PREFIX_PATH CMAKE_MODULE_PATH
I have no idea how CMAKE_MODULE_PATH, CMAKE_PREFIX_PATH work,
It seems not add to search list for find_package()
Limiting the Scope of Variables in CMake to specific Projects/Subdirectories
I would like to set a variable that is available for modification in a third-party library which I have included as a subdirectory (add_subdirectory(.../third_party/libA)
). The library allows me to enable/disable certain portions of the build process such as to including testing targets, for example: set(BUILD_TESTS OFF)
.
howto install targets recursively in cmake
I would have expected the following to work recursively through the target dependency hierarchy:
Environment variable is null in CMakeLists.txt, but it’s right in CommandLine in clion
Environment: wsl22.04
gcc11.4
make 4.21
(the clion project uses the wsl.exe as terminal, and Toolchains are all in wsl22.04.)
Unable to determine what CMake generator to use when using Cmake: Configure command (VScode, windows 11)
I made a fresh new project from an empty folder using the quick start command. In the folder are the cmakelists.txt and main.cpp files only. When running any command (such as Configure, Edit Cache…), I get this error output:
Shorter way of configuring all imported configurations in CMake?
I have a library that I usually build in Debug
and Release
or RelWithDebInfo
mode. When using that library, I get warning from CMake policy CMP0111.
A CMake lib include & use other third party lib as git submodule, when use main lib in other project, error report that third party lib are missing
I m a newbie in cmake and encountered problem as i use it, error `The following imported targets are referenced, but are missing` showed up, there is a similar question here but i could not get it right in my mind. here is my folder structure.