[CMake] CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true

John Drescher drescherjm at gmail.com
Mon Dec 14 12:22:24 EST 2009


On Mon, Dec 14, 2009 at 12:21 PM, John Drescher <drescherjm at gmail.com> wrote:
> On Mon, Dec 14, 2009 at 12:16 PM, Tyler Roscoe <tyler at cryptio.net> wrote:
>> On Mon, Dec 14, 2009 at 12:07:33PM -0500, John Drescher wrote:
>>> SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
>>> CACHE STRING "Default Install Path")
>>>
>>> if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>>    set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING
>>> "Install path" FORCE)
>>>    message("CMAKE_INSTALL_PREFIX Initialized to default setting to "
>>> ${DEFAULT_INSTALL_PATH})
>>> else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>>    message("CMAKE_INSTALL_PREFIX not Initialized to default keeping "
>>> ${CMAKE_INSTALL_PREFIX})
>>> endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
>>>
>>> ENDIF(WIN32)
>>>
>>> The expected value for the QtBasicUtils project is if the user did not
>>> change CMAKE_INSTALL_PREFIX the path should be
>>> C:/Program Files (x86)/UPMC/QtBasicUtils
>>>
>>> on 64 bit systems or
>>>
>>> C:/Program Files/UPMC/QtBasicUtils
>>>
>>> on 32 bit systems
>>>
>>> However this is not getting set and I get the following message in my log:
>>> CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program
>>> Files (x86)/QtBasicUtils
>>
>> Clean out your cache? Looks like your cache has CMAKE_INSTALL_PREFIX set
>> to 'C:/Program Files (x86)/QtBasicUtils', which is not the default, so
>> your script is behaving as it should and not clobbering the value.
>>
>
> CMAKE_INSTALL_PREFIX is not in the cache. I thought that was default
> on 64 bit windows.
>

Correction. 64 bit windows compiling a 32 bit application using visual studio.

John


More information about the CMake mailing list