[CMake] CMAKE_INSTALL_PREFIX: Win32 quoting problem

Stephen Collyer scollyer at netspinner.co.uk
Wed Mar 25 07:10:00 EDT 2009


I've got the following code in my top-level CMakeLists.txt file:

IF (WIN32)
    SET(CMAKE_INSTALL_PREFIX
"$ENV{ProgramFiles}\${PROJECT_NAME}_${VERSION}")
    SET(CPACK_GENERATOR "ZIP")
ELSE(WIN32)
    SET(CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}_${VERSION}")
    SET(CPACK_GENERATOR "RPM")
ENDIF(WIN32)

Regardless of how I try to construct the Win32 CMAKE_INSTALL_PREFIX, I get
some kind of quoting-related
problem e,g:

CMake Error: Invalid escape sequence \P
Syntax error in cmake code at
C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CPack.cmake:788:
syntax error, unexpected cal_ERROR, expecting $end (4), when parsing string
"C:\Program Files\MDP_1.0.0"

with variants, depending on presence/absence of quotes and number of \

Can someone put me out of my misery and tell me what I need to do to get
this right ?

Steve Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090325/1fadbca2/attachment.htm>


More information about the CMake mailing list