[CMake] is ccmake reliable?

James C. Sutherland James.Sutherland at utah.edu
Tue Sep 15 19:34:11 EDT 2009


On Sep 15, 2009, at 2:47 PM, Tyler Roscoe wrote:

> On Tue, Sep 15, 2009 at 02:20:35PM -0600, James C. Sutherland wrote:
>>>>> 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.
>
> I guess its intended use is for something like this:
>
> if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>    set (CMAKE_INSTALL_PREFIX "myPrefix" CACHE FORCE ...)
> endif ()
>

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
   set (CMAKE_INSTALL_PREFIX
     ${CMAKE_CURRENT_BINARY_DIR}
     CACHE PATH "" FORCE
     )
endif()

This did what I want.  It sets the default value for what I want, and  
allows the user to reset it when running ccmake.

Thanks for the tips!

James


More information about the CMake mailing list