If in my CMakeLists.txt
I have (order #1)
...
set (CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
project ("my_project")
...
on first run I get in ccmake
CMAKE_VERBOSE_MAKEFILE *ON
But if I invert the order of set (CMAKE_VERBOSE_MAKEFILE ...
and project ...
(order #2)
...
project ("my_project")
set (CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
...
I get on first run
CMAKE_VERBOSE_MAKEFILE *OFF
Since I have many projects largely sharing configuration, I want to have a common CMakeLsts.txt
, and a project-specific CMakeLsts.txt
with the minimum project-specific contents, and an include
project ("my_project")
set (COMMON_DIR "${CMAKE_SOURCE_DIR}/../common")
include ("${COMMON_DIR}/CMakeLists.txt")
and setting CMAKE_VERBOSE_MAKEFILE=ON
in ${COMMON_DIR}/CMakeLists.txt
.
So I seem to be forced to work with order #2.
Under these conditions,
- Only having the minimum project-specific contents in the project
CMakeLsts.txt
(so excluding settingCMAKE_VERBOSE_MAKEFILE=ON
). - Setting
CMAKE_VERBOSE_MAKEFILE=ON
for the first run in the commonCMakeLsts.txt
.
what are (perhaps more than one) possible ways of getting CMAKE_VERBOSE_MAKEFILE=ON
on first run, and then using the cache?
From what I tried, using FORCE
is not useful, since if I change the value to something different (OFF
in this case), it will revert the value to ON
with each run.
I wouldn't want to move setting CMAKE_VERBOSE_MAKEFILE=ON
to my project-specific CMakeLists.txt
.
Related