CMake Command Line Keyword
This is a feature request. Do you think it would be possible to add a keyword similar to IN_LIST
that allows one to easily detect whether something was specified via the command line, e.g.:
if(IN_COMMAND_LINE MY_OPTION)
# ...
The scenario I am hoping to resolve is when an option like enabling CUDA support in the package is explicitly requested, e.g. -DENABLE_CUDA_SUPPORT=ON
so that I can throw an error if enabled_language(CUDA)
fails, but not throw an error if there was not an explicit request for it. A long time ago, I found a bit of code that let me determine if it was explicitly set but I remember this being non-trivial. If there is an easy way to do this without this new feature, please let me know.