CMakeDependentOption ¶ Macro to provide an option dependent on other options. This macro presents an option to the user only if a set of other conditions are true. CMake build for libyaml stable. GitHub Gist: instantly share code, notes, and snippets. Provides an option for the user to select as ON or OFF. If no initial is provided, OFF is used. If is already set as a normal or cache variable, then the command does nothing (see policy CMP0077). If you have options that depend on the values of other options, see the module help for CMakeDependentOption. CMakeDependentOption-Macro to provide an option dependent on other options. This macro presents an option to the user only if a set of other: conditions are true. Code-block:: cmake: cmakedependentoption( ' ) Where ```` is available to the user if ```` is true.
Hi, I've just created my first full-scale CMake project, but I have a lot to learn. My project builds an executable and a set of shared libraries. The build of each shared library is enabled by a CMake option. I'm now considering how to present these options to fellow developers who aren't familiar with CMake.
The developer will want to build a subset of libraries that depends on the project he/she is working on. How would I implement ‘super-options' that would switch a set of options ON?
Cmakedependentoption.cmake
i.e. Proj1 requires -D Option1=ON Option3=ON
I guess I could do this with a shell script.
Or I could do it in CMakeLists.txt:
or is there a better way?
I noticed that VS Code extension ‘CMake-Tools' has a concept of ‘CMake Variants'. Does CMake have anything similar?
Any recommendations appreciated.
BR
David
Hi, I've just created my first full-scale CMake project, but I have a lot to learn. My project builds an executable and a set of shared libraries. The build of each shared library is enabled by a CMake option. I'm now considering how to present these options to fellow developers who aren't familiar with CMake.
The developer will want to build a subset of libraries that depends on the project he/she is working on. How would I implement ‘super-options' that would switch a set of options ON?
i.e. Proj1 requires -D Option1=ON Option3=ON
Any recommendations appreciated.
BR
David
Hi, I've just created my first full-scale CMake project, but I have a lot to learn. My project builds an executable and a set of shared libraries. The build of each shared library is enabled by a CMake option. I'm now considering how to present these options to fellow developers who aren't familiar with CMake.
The developer will want to build a subset of libraries that depends on the project he/she is working on. How would I implement ‘super-options' that would switch a set of options ON?
i.e. Proj1 requires -D Option1=ON Option3=ON
Cmakedependentoption Example
I guess I could do this with a shell script.
Cmake Include(cmakedependentoption)
Or I could do it in CMakeLists.txt:
or is there a better way?
I noticed that VS Code extension ‘CMake-Tools' has a concept of ‘CMake Variants'. Does CMake have anything similar?
Any recommendations appreciated.
BR
David