The following command works for me well:
cmake ../ -DBoost_NO_BOOST_CMAKE=BOOL:ON
i.e., cmake ignores system BoostConfig.cmake
, which is what I need. But if I try to do the same via an environment variable:
Boost_NO_BOOST_CMAKE=ON cmake ../
cmake still reads BoostConfig.cmake
and I got the following error:
CMake Error at /usr/lib64/boost/BoostConfig.cmake:64 (get_target_property):
I've tried also setting to TRUE
, BOOL:ON
, etc. as well. Using cmake version 3.3.1. Any hint?
UPDATE
Adding
set(Boost_NO_BOOST_CMAKE TRUE)
into CMakeList.txt
works well, but the same line added into PreLoad.cmake
does not. In the second case, running cmake with trace and debug options gives the following first few log lines:
Configuring Debug su3-dense ...
Running with debug output on.
Running with trace output on.
/home/langr/projects/su3dense/PreLoad.cmake(1): set(Boost_NO_BOOST_CMAKE TRUE )
/home/langr/projects/su3dense/CMakeLists.txt(1): cmake_minimum_required(VERSION 3.0.0 )
...
So, the PreLoad.cmake
file is apparently processed and the variable Boost_NO_BOOST_CMAKE
is set. Why is this setting then ignored?
UPDATE 2
I finally got it working by writing
set(Boost_NO_BOOST_CMAKE TRUE CACHE BOOL "" FORCE)
into PreLoad.cmake
.