Re: [CMake] Strange behaviour with -D option
Use something like SET (GUI ${GUI} CACHE BOOL description) To put proper initial value from command line into cache. It won't be overwritten on the second run. On Jul 1, 2011 2:02 PM, pellegrini pellegr...@ill.fr wrote: Hello everybody, there is a behaviour I do not understand when using cmake with -D option. In my project I defined a few CACHE variables. One of them is GUI to specify whether or not my project should be built with graphical library support. So in my main CMakeLists.txt I wrote something like: SET(GUI FALSE CACHE BOOL do the build in GUI mode) PROJECT(crysfml Fortran) ... When launching cmake with: cmake -G NMake Makefiles -D CMAKE_Fortran_COMPILER=ifort -D GUI=TRUE ..\..\. I always get the following message # GUI VALUE = TRUE -- Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_Fortran_COMPILER= ifort -- The Fortran compiler identification is Intel -- Check for working Fortran compiler: C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe -- Check for working Fortran compiler: C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe supports Fortran 90 -- Checking whether C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe supports Fortran 90 -- yes GUI VALUE = FALSE -- Configuring done -- Generating done -- Build files have been written to: C:/Datas/Eclipse/workspace/crysfml/build/ifort_release_win # and the worse it that when deleting the cache and rebuilding it, the GUI variable is switched to FALSE as you can see in the two MESSAGE commands I put in my code (GUI VALUE =). Though, I would tend to think that the -D command should have the last word. There should be something I completely missed. thanks a lot see you Eric -- Eric Pellegrini Calcul Scientifique Institut Laue-Langevin Grenoble, France ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Strange behaviour with -D option
On 07/01/2011 12:02 PM, pellegrini wrote: Hello everybody, there is a behaviour I do not understand when using cmake with -D option. In my project I defined a few CACHE variables. One of them is GUI to specify whether or not my project should be built with graphical library support. So in my main CMakeLists.txt I wrote something like: SET(GUI FALSE CACHE BOOL do the build in GUI mode) PROJECT(crysfml Fortran) ... When launching cmake with: cmake -G NMake Makefiles -D CMAKE_Fortran_COMPILER=ifort -D GUI=TRUE ..\..\. I always get the following message # GUI VALUE = TRUE -- Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_Fortran_COMPILER= ifort -- The Fortran compiler identification is Intel -- Check for working Fortran compiler: C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe -- Check for working Fortran compiler: C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe supports Fortran 90 -- Checking whether C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe supports Fortran 90 -- yes GUI VALUE = FALSE -- Configuring done -- Generating done -- Build files have been written to: C:/Datas/Eclipse/workspace/crysfml/build/ifort_release_win # and the worse it that when deleting the cache and rebuilding it, the GUI variable is switched to FALSE as you can see in the two MESSAGE commands I put in my code (GUI VALUE =). Though, I would tend to think that the -D command should have the last word. There should be something I completely missed. thanks a lot see you Eric FYI, see [1,2]. ATM, until 9980 is addressed, the best you can do when changing compilers is throwing away the build tree, starting all over with a fresh/empty one and specifying the compilers via the CC/CXX/FC environment variables, the usually recommended way. As an alternative, provide one build tree per set of compilers from the first. In case of numerous -D settings, you might use CMake's -C option for convenience. Regards, Michael [1] http://www.mail-archive.com/cmake@cmake.org/msg34486.html [2] http://public.kitware.com/Bug/view.php?id=9980 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Strange behaviour with -D option
Hello everybody, there is a behaviour I do not understand when using cmake with -D option. In my project I defined a few CACHE variables. One of them is GUI to specify whether or not my project should be built with graphical library support. So in my main CMakeLists.txt I wrote something like: SET(GUI FALSE CACHE BOOL do the build in GUI mode) PROJECT(crysfml Fortran) ... When launching cmake with: cmake -G NMake Makefiles -D CMAKE_Fortran_COMPILER=ifort -D GUI=TRUE ..\..\. I always get the following message # GUI VALUE = TRUE -- Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_Fortran_COMPILER= ifort -- The Fortran compiler identification is Intel -- Check for working Fortran compiler: C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe -- Check for working Fortran compiler: C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe supports Fortran 90 -- Checking whether C:/Intel/Compiler/11.1/054/bin/ia32/ifort.exe supports Fortran 90 -- yes GUI VALUE = FALSE -- Configuring done -- Generating done -- Build files have been written to: C:/Datas/Eclipse/workspace/crysfml/build/ifort_release_win # and the worse it that when deleting the cache and rebuilding it, the GUI variable is switched to FALSE as you can see in the two MESSAGE commands I put in my code (GUI VALUE =). Though, I would tend to think that the -D command should have the last word. There should be something I completely missed. thanks a lot see you Eric -- Eric Pellegrini Calcul Scientifique Institut Laue-Langevin Grenoble, France ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake