I have the need to pass a binary option to my build process. I pass the option as cache variable:
cmake ... -DMY_OPTION=1
Within one of the
CMakeLists.txt, I ask for the existence of this parameter:
if (DEFINED MY_OPTION)
This works as expected, but I will see the warning:
CMake Warning: Manually-specified variables were not used by the project: MY_OPTION
This behavior was already reported (https://gitlab.kitware.com/cmake/cmake/-/issues/18152). Is there an other, more obvious ways to pass binary options, that would not trigger the warning?