modern-cmake-sample | Sample C project which uses modern CMake to build | Build Tool library
kandi X-RAY | modern-cmake-sample Summary
kandi X-RAY | modern-cmake-sample Summary
Sample C++ project which uses modern CMake to build
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of modern-cmake-sample
modern-cmake-sample Key Features
modern-cmake-sample Examples and Code Snippets
Community Discussions
Trending Discussions on modern-cmake-sample
QUESTION
Many build systems (such as make) sometimes prompt the user to confirm his intention if large dependencies must be downloaded and installed from the internet to continue with the build process.
What is the best way to achieve this from CMake?
My example application. I'm adapting a CMakeLists.txt
file that installs Google Test framework if it isn't found. How should I modify this to ask the user for permission before installing it?
Alternatively, perhaps this is not possible/standard and I should instead just require the user to pass a variable definition when calling CMake, to assert his consent to the download?
...ANSWER
Answered 2020-Dec-09 at 18:08Passing a variable to CMake is a proper way for specify an user decision.
Asking a user for confirm some default decision looks nice... but I fear CMake has no ready-to-use tools for that. Note, that configuration of the project could be requested both in shell/terminal (via cmake
executable) and from CMake GUI, which is not connected with the user input.
Instead of asking the user for confirmation during the configuration process, you may fail configuration (e.g. with message(FATAL_ERROR)
). But ship this fail with the message describing the variable a user needs to set.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install modern-cmake-sample
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page