How to make CMake not forget the command-line parameters
William A. Hoffman
billlist at nycap.rr.com
Sun May 21 03:03:14 CEST 2006
At 05:34 PM 5/20/2006, Thiago Macieira wrote:
>Is there a way to make CMake not forget the parameters I give it in the
>command-line?
>
>Every time I modify one CMakeLists.txt file, the values I had passed in
>the command-line are reset to their defaults. Automake/Autoconf
>had "config.status" that remembered those values, but I can't find the
>equivalent for CMake.
>
>I had this in CMakeCache.txt:
>$ grep CMAKE_CXX_COMPILER CMakeCache.txt
>CMAKE_CXX_COMPILER:FILEPATH=/opt/teambuilder2/bin/g++
>
>Then I modified one CMakeLists.txt file and ran make:
>$ make -j25
>make: Entering directory `/home/tjmaciei/obj/kde4/KDE/kdelibs/khtml'
>-- Found Qt-Version 4.1.3-snapshot-20060502
>-- Building kdelibs...
>[...]
>$ grep CMAKE_CXX_COMPILER CMakeCache.txt
>CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
>
>This means, of course, that 25 instances of the C++ compiler made my
>machine VERY sluggish.
Something very odd is happening. CMake should not change the compiler
during a cmake run. Can you try it with a smaller cmake project
and see what happens? The CMakeCache.txt file can should only be
changed if a set FORCE is done. Once something is in the CMakeCache.txt
it should not change.
Try a simple cmakelist file like this:
add_executable(foo foo.cxx)
I can not figure out what would cause that to happen, must be a bug
of some sort. Is this CMake 2.4.2?
-Bill
>PS: Why does CMake search for "c++" instead of "g++"?
It just does. In some version of g++ that I used at some
point (most likely 10 years ago) it made a difference as to which
run time libraries were used. Is there a difference between
c++ and g++ these days at all?
More information about the Kde-buildsystem
mailing list