diff options
Diffstat (limited to 'Modules/CPack.cmake')
-rw-r--r-- | Modules/CPack.cmake | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 316f269..18fe53a 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -1,3 +1,7 @@ +# Default output files will be CPackConfig.cmake and CPackSourceConfig.cmake. +# This can be overwritten with CPACK_OUTPUT_CONFIG_FILE and +# CPACK_SOURCE_OUTPUT_CONFIG_FILE. + # Pick a configuration file SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in") IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") @@ -16,6 +20,10 @@ MACRO(cpack_set_if_not_set name value) ENDMACRO(cpack_set_if_not_set) # Macro to encode variables for the configuration file +# find any varable that stars with CPACK and create a variable +# _CPACK_OTHER_VARIABLES_ that contains SET commands for +# each cpack variable. _CPACK_OTHER_VARIABLES_ is then +# used as an @ replacment in configure_file for the CPackConfig. MACRO(cpack_encode_variables) SET(_CPACK_OTHER_VARIABLES_) GET_CMAKE_PROPERTY(res VARIABLES) @@ -103,9 +111,14 @@ cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}") cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "@CPACK_PACKAGE_INSTALL_DIRECTORY@") +cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE + "${CMAKE_BINARY_DIR}/CPackConfig.cmake") + +cpack_set_if_not_set(CPACK_SOURCE_OUTPUT_CONFIG_FILE + "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake") + cpack_encode_variables() -CONFIGURE_FILE("${cpack_input_file}" - "${CMAKE_BINARY_DIR}/CPackConfig.cmake" @ONLY IMMEDIATE) +CONFIGURE_FILE("${cpack_input_file}" "${CPACK_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE) # Generate source file cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES @@ -125,4 +138,4 @@ SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}") cpack_encode_variables() CONFIGURE_FILE("${cpack_source_input_file}" - "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake" @ONLY IMMEDIATE) + "${CPACK_SOURCE_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE) |