non-set-able variables

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

non-set-able variables

Voisard, Shane S CIV NSWCDD, K54
I made my parent script cd into my "binary_dir", execute (the command-line) cmake from there and all is well ..... except for another set command (in the top-level CMakeLists.txt) that is no longer effective:

set (CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "" FORCE)

I tried this alternative, with no effect, based upon online 2.6 documentation:

set (CMAKE_CONFIGURATION_TYPES "Release" CACHE INTERNAL "" FORCE)

Previously, when I ran cmake-gui.exe, setting this variable caused cmake to generate visual studio vcproj files with only the 'release' configuration.  But the command-line cmake does not create this output in spite of this set command.

I will hazard a guess that this is another cmake variable (including CMAKE_BINARY_DIR & others) that is set-able in the GUI, before the 1st configuration, but not set-able in the command-line cmake ?

Upon reflection, I think there is a major issue here:
1) Online documentation does not categorize set-able vs. non-set-able variables.
2) cmake-gui variable-setting behavior differs significantly from cmake-cmdline variable-setting behavior.
3) most importantly -- my efforts to debug via message() output did not help me to clarify this situation.  I output these cmake variables' values before and after setting them, cmake reported these values had changed, but the values did not take effect.
 
Currently, there is no way for me to know that cmake ignores these set commands.   A fix could be:
1) cmake reports "warning: readonly variable $(CMAKE_FOO) cannot be set"
2) message() reports  only the *effective* value of variables, indicating that such set commands are ignored.
3) the online documentation could categorize the variables and state their set-ability with respect to cmake-gui and cmake-cmdline.

I went back and searched the cmake FAQ and the cmake bugtracker postings regarding 'variable(s)' and 'set(ting)', but I didn't find an question / issue  like this one.

Shane Voisard
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: non-set-able variables

Tyler Roscoe
On Tue, Nov 24, 2009 at 04:15:19PM -0600, Voisard, Shane S CIV NSWCDD, K54 wrote:
> set (CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "" FORCE)
>
> I tried this alternative, with no effect, based upon online 2.6 documentation:
>
> set (CMAKE_CONFIGURATION_TYPES "Release" CACHE INTERNAL "" FORCE)

I can't say if this is a bug or how good your other ideas are, but some
possible workarounds:

- did you delete your cache and let the CMake run by your script
  recreate it?

- during your first call to CMake, have you tried using
  -DCMAKE_CONFIGURATION_TYPES="Release"?

tyler
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: non-set-able variables

Voisard, Shane S CIV NSWCDD, K54
In reply to this post by Voisard, Shane S CIV NSWCDD, K54
I did not thoroughly test the CMAKE_CONFIGURATION_TYPES problem that I previously reported. I must have confused this problem with a similar problem that I encountered when I tried (and failed) to set CMAKE_BINARY_DIR when running the command-line cmake.
 
I re-tested this problem and found that cmake is functioning properly.  Thank you for your suggestions.
 
Shane
_______________________________________________
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