[CMake] CMAKE_INSTALL_PREFIX
George Neill
georgen at neillnet.com
Wed Mar 18 14:07:11 EDT 2009
John,
On Wed, Mar 18, 2009 at 12:57 PM, John Drescher <drescherjm at gmail.com> wrote:
>> Here is what I do for Program Files
>>
>> string (REPLACE "\\" "/" PGM_FILES $ENV{PROGRAMFILES})
>>
>> then I use PGM_FILES and there is no complaint about bad escape sequences.
>>
> BTW, here is the whole section:
>
> IF(WIN32)
>
> #The following command changes \ to / in the Program Files Path so
> CMake will not complain
> #about bad escape sequences.
> string (REPLACE "\\" "/" PGM_FILES $ENV{PROGRAMFILES})
>
> SET (CMAKE_INSTALL_PREFIX ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
> CACHE STRING "Default Install Path" FORCE)
> ENDIF(WIN32)
>
.. and even if you pass in as a command line option
-D"CMAKE_INSTALL_PREFIX=" ? I couldn't get FORCE to work either.
Possibly because I was using INTERNAL and not STRING.
It seems the following works (at least the cmake_install.cmake
commands appear to get generated appropriately).
FILE(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
Is there a CMPxxxx policy which deals with this which I have missed?
Thanks,
George.
More information about the CMake
mailing list