[CMake] is ccmake reliable?

David Cole david.cole at kitware.com
Tue Sep 15 14:50:41 EDT 2009


I believe the word used was "reproducible" not "reliable" -- and I think he
was talking about the fact that it is not reproducible because it depends on
human interaction. Other than the human sitting at the keyboard, I have
found ccmake (and *all* of the cmake executables) to be quite reliable.
The thing that is confusing you about the CMAKE_INSTALL_PREFIX value is
something that it takes everyone a while to get their heads around... The
*cached* value (that you see in the GUI) is not the same as the local
variable value in the CMakeLists.txt file. When you use set(var "value") in
a CMakeLists.txt file using a variable name that is also in the cache, you
are only affecting the local value in the CMakeLists.txt file, not the cache
value.

And when you print it out (and when CMake generates make files) it is the
local value that matters, not the cached value that you see in the GUI.

Once you get your head around that concept, I think you'll find ccmake is
quite reliable. :-)


HTH,
David




On Tue, Sep 15, 2009 at 2:37 PM, James C. Sutherland <
James.Sutherland at utah.edu> wrote:

> On another mailing list that I subscribe to someone mentioned that ccmake
> was not very reliable.  Is this true?
>
> A related question:  If I set CMAKE_INSTALL_PREFIX in my CMakeLists.txt
> file
>
>> set( CMAKE_INSTALL_PREFIX
>>  ${CMAKE_CURRENT_BINARY_DIR}
>>  )
>>
> and then run ccmake, I find that the CMAKE_INSTALL_PREFIX variable is set
> to /usr/local rather than the binary directory.  Is this a bug?  I ran
> ccmake on a clean build directory, i.e. I had no cache.  Incidentally, this
> also occurs with the CMake gui.  If I dump the variable from my
> CMakeLists.txt file, e.g.
>
>>  message( STATUS "Files will be installed to: " ${CMAKE_INSTALL_PREFIX} )
>>
>
> then it reflects the correct directory, but the CMakeCache.txt file still
> shows /usr/local.  Am I misunderstanding something?
>
> Thanks,
>
> James
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090915/f24e2d86/attachment.htm>


More information about the CMake mailing list