[CMake] Problem: Cannot change name of installer package with CPack

Stephen Torri stephen.torri at gmail.com
Thu Jul 7 11:44:50 EDT 2011


Problem: Cannot change name of installer package.
Cmake version: 2.8.4

I am trying to change the value of CPACK_PACKAGE_NAME depending upon which
build was performed. What I am seeing is that CPACK_PACKAGE_NAME is always
set to the project name. The code I am using to try and change the name is
below. How can I change the CPACK_PACKAGE_NAME value depending upon if I
send Debug or Release as an option to cpack (e.g. cpack -C Debug)?

IF(CMAKE_BUILD_TYPE MATCHES Release)
  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME} )
  MESSAGE(STATUS "Project name: " ${CPACK_PACKAGE_NAME} )
ELSEIF(CMAKE_BUILD_TYPE MATCHES Debug)
  SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}_debug")
  MESSAGE(STATUS "Project name: " ${CPACK_PACKAGE_NAME} )
ENDIF(CMAKE_BUILD_TYPE MATCHES Release)

Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110707/5216d31f/attachment.htm>


More information about the CMake mailing list