[CMake] is ccmake reliable?

Tyler Roscoe tyler at cryptio.net
Tue Sep 15 16:15:05 EDT 2009


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).

You can use FORCE to overcome this, but it usually isn't what you want.

tyler


More information about the CMake mailing list