[CMake] Changes to how CMAKE_INCLUDE_PATH / CMAKE_LIBRARY_PATH function in 2.6.x

Alexander Neundorf a.neundorf-work at gmx.net
Mon Nov 17 16:15:13 EST 2008


On Sunday 16 November 2008, Philip Lowman wrote:
> I noticed local CMake variables for CMAKE_INCLUDE_PATH and


Hmm, I can't reproduce the problem:

$ cat CMakeLists.txt
CMakeLists.txt: No such file or directory
$ touch CMakeLists.txt
$ /opt/cmake-HEAD/bin/cmake .
...
-- Build files have been written to: /home/alex/src/tests/cmakecachevar
$ grep CMAKE_INCLUDE_PATH CMakeCache.txt
$ 

(so it's not in the cache yet, now let's set it manually)

$ /opt/cmake-HEAD/bin/cmake -DCMAKE_INCLUDE_PATH=/bar .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alex/src/tests/cmakecachevar
$ grep CMAKE_INCLUDE_PATH CMakeCache.txt
CMAKE_INCLUDE_PATH:UNINITIALIZED=/bar
$     

(ok, now it is in the cache, now try to change it)

$ /opt/cmake-HEAD/bin/cmake -DCMAKE_INCLUDE_PATH=/foo .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alex/src/tests/cmakecachevar
$ grep CMAKE_INCLUDE_PATH CMakeCache.txt
CMAKE_INCLUDE_PATH:UNINITIALIZED=/foo
$

(also works, now see what happens if I set() it in the CMakeLists.txt)

$ echo "message(STATUS \"CMAKE_INCLUDE_PATH: \${CMAKE_INCLUDE_PATH}\")" >> 
CMakeLists.txt
$ /opt/cmake-HEAD/bin/cmake -DCMAKE_INCLUDE_PATH=/foo .
-- CMAKE_INCLUDE_PATH: /blub
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alex/src/tests/cmakecachevar
$ 

So the one using set() has overridden all others.
What behaviour did you expect ?

Alex


More information about the CMake mailing list