[CMake] is ccmake reliable?
James C. Sutherland
James.Sutherland at utah.edu
Tue Sep 15 16:20:35 EDT 2009
On Sep 15, 2009, at 2:15 PM, Tyler Roscoe wrote:
> On Tue, Sep 15, 2009 at 02:08:44PM -0600, James C. Sutherland wrote:
>> So assuming that I wanted my CMakeLists.txt file to modify the
>> default
>> install location, but allow the user to change this, wouldn't I do
>> something like:
>>> set( CMAKE_INSTALL_PREFIX
>>> ${CMAKE_CURRENT_BINARY_DIR}
>>> CACHE PATH "installation path"
>>> )
>> This doesn't work - I assume that this is because
>> CMAKE_INSTALL_PREFIX
>> is a special (internally defined) variable? When I run ccmake and
>> configure, the value remains as /usr/local.
>
> This will work when generating a new cache. If you have a pre-existing
> cache, CMake won't override the value in there (otherwise how could a
> user ever provide her own values for cache variables).
>
After wiping my cache (and the entire build directory) clean, I ran
ccmake (configure) and the CMAKE_INSTALL_PREFIX was set to /usr/
local. The only way I can get it to modify the CMAKE_INSTALL_PREFIX
by default (i.e. through the CMakeLists.txt file) is by removing the
CACHE PATH portion. But then it isn't cached (obviously).
More information about the CMake
mailing list