Fix regression with CPACK_NSIS_PACKAGE_NAME, if the project is setting the CPACK_NSIS_DISPLAY_NAME then use that as the default value and not the CPACK_PACKAGE_INSTALL_DIRECTORY, also make sure it escapes \ correctly.

This commit is contained in:
Bill Hoffman 2009-11-12 17:58:37 -05:00
parent fb8d583054
commit 6e8aa6cb52
1 changed files with 16 additions and 2 deletions

View File

@ -793,9 +793,23 @@ cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
# if the user has set CPACK_NSIS_DISPLAY_NAME remember it
if(DEFINED CPACK_NSIS_DISPLAY_NAME)
SET(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
endif()
# if the user has set CPACK_NSIS_DISPLAY
# explicitly, then use that as the default
# value of CPACK_NSIS_PACKAGE_NAME instead
# of CPACK_PACKAGE_INSTALL_DIRECTORY
cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
if(CPACK_NSIS_DISPLAY_NAME_SET)
string(REPLACE "\\" "\\\\"
_NSIS_DISPLAY_NAME_TMP "${CPACK_NSIS_DISPLAY_NAME}")
cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${_NSIS_DISPLAY_NAME_TMP}")
else()
cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
endif()
cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE
"${CMAKE_BINARY_DIR}/CPackConfig.cmake")