From e65c40f94a15f5e70695bd5c08444fc42262940c Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 31 Oct 2007 12:55:04 -0400 Subject: ENH: add CPACK_PROJECT_CONFIG_FILE option to CPack --- CMakeCPack.cmake | 3 +++ CMakeCPackOptions.cmake.in | 36 ++++++++++++++++++++++++++++++++ CPackConfig.cmake.in | 33 ----------------------------- CPackSourceConfig.cmake.in | 8 ------- Source/CPack/cmCPackGenericGenerator.cxx | 10 ++++++++- 5 files changed, 48 insertions(+), 42 deletions(-) create mode 100644 CMakeCPackOptions.cmake.in delete mode 100644 CPackConfig.cmake.in delete mode 100644 CPackSourceConfig.cmake.in diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index b988d17..f511895 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -4,6 +4,9 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") SET(CMAKE_INSTALL_MFC_LIBRARIES 1) INCLUDE(InstallRequiredSystemLibraries) ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") + CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" + "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) + SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") SET(CPACK_PACKAGE_VENDOR "Kitware") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in new file mode 100644 index 0000000..f1be2e8 --- /dev/null +++ b/CMakeCPackOptions.cmake.in @@ -0,0 +1,36 @@ +if(CPACK_GENERATOR MATCHES "NSIS") + # set the install/unistall icon used for the installer itself + # There is a bug in NSI that does not handle full unix paths properly. + SET(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") + SET(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") + # set the package header icon for MUI + SET(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp") + # tell cpack to create links to the doc files + SET(CPACK_NSIS_MENU_LINKS + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/CMakeSetup.html" "CMakeSetup Help" + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html" + "CMake Properties and Variables Help" + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/ctest.html" "CTest Help" + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-modules.html" "CMake Modules Help" + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-commands.html" "CMake Commands Help" + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help" + "http://www.cmake.org" "CMake Web Site" + ) + # tell cpack the executables you want in the start menu as links + SET(CPACK_PACKAGE_EXECUTABLES "CMakeSetup" "CMake" ) + # tell cpack to create a desktop link to CMakeSetup + SET(CPACK_CREATE_DESKTOP_LINK_CMakeSetup ON) + SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\CMakeSetup.exe") + SET(CPACK_NSIS_DISPLAY_NAME "@CPACK_PACKAGE_INSTALL_DIRECTORY@ a cross-platform, open-source build system") + SET(CPACK_NSIS_HELP_LINK "http:\\\\www.cmake.org") + SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\www.kitware.com") + SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) + SET(CPACK_NSIS_MODIFY_PATH ON) +endif(CPACK_GENERATOR MATCHES "NSIS") + +if(CPACK_GENERATOR MATCHES "CygwinSource") + # when packaging source make sure the .build directory is not included + SET(CPACK_SOURCE_IGNORE_FILES + "/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$") +endif(CPACK_GENERATOR MATCHES "CygwinSource") diff --git a/CPackConfig.cmake.in b/CPackConfig.cmake.in deleted file mode 100644 index 6c92d0c..0000000 --- a/CPackConfig.cmake.in +++ /dev/null @@ -1,33 +0,0 @@ -# all CPACK_ variables from the cmake project -@_CPACK_OTHER_VARIABLES_@ - -if(CPACK_GENERATOR MATCHES "NSIS") - # set the install/unistall icon used for the installer itself - # There is a bug in NSI that does not handle full unix paths properly. - SET(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") - SET(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") - # set the package header icon for MUI - SET(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp") - # tell cpack to create links to the doc files - SET(CPACK_NSIS_MENU_LINKS - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/CMakeSetup.html" "CMakeSetup Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html" - "CMake Properties and Variables Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/ctest.html" "CTest Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-modules.html" "CMake Modules Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-commands.html" "CMake Commands Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help" - "http://www.cmake.org" "CMake Web Site" - ) - # tell cpack the executables you want in the start menu as links - SET(CPACK_PACKAGE_EXECUTABLES "CMakeSetup" "CMake" ) - # tell cpack to create a desktop link to CMakeSetup - SET(CPACK_CREATE_DESKTOP_LINK_CMakeSetup ON) - SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\CMakeSetup.exe") - SET(CPACK_NSIS_DISPLAY_NAME "@CPACK_PACKAGE_INSTALL_DIRECTORY@ a cross-platform, open-source build system") - SET(CPACK_NSIS_HELP_LINK "http:\\\\www.cmake.org") - SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\www.kitware.com") - SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) - SET(CPACK_NSIS_MODIFY_PATH ON) -endif(CPACK_GENERATOR MATCHES "NSIS") diff --git a/CPackSourceConfig.cmake.in b/CPackSourceConfig.cmake.in deleted file mode 100644 index 46b8eee..0000000 --- a/CPackSourceConfig.cmake.in +++ /dev/null @@ -1,8 +0,0 @@ -# All CPACK_ variables from the cmake project -@_CPACK_OTHER_VARIABLES_@ - -if(CPACK_GENERATOR MATCHES "CygwinSource") - # when packaging source make sure the .build directory is not included - SET(CPACK_SOURCE_IGNORE_FILES - "/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$") -endif(CPACK_GENERATOR MATCHES "CygwinSource") diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx index e961357..51d1018 100644 --- a/Source/CPack/cmCPackGenericGenerator.cxx +++ b/Source/CPack/cmCPackGenericGenerator.cxx @@ -60,7 +60,6 @@ void cmCPackGenericGenerator::DisplayVerboseOutput(const char* msg, //---------------------------------------------------------------------- int cmCPackGenericGenerator::PrepareNames() { - this->SetOption("CPACK_GENERATOR", this->Name.c_str()); std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY"); tempDirectory += "/_CPack_Packages/"; @@ -754,6 +753,15 @@ int cmCPackGenericGenerator::Initialize(const char* name, cmMakefile* mf, "Cannot initialize the generator" << std::endl); return 0; } + // set the running generator name + this->SetOption("CPACK_GENERATOR", this->Name.c_str()); + // Load the project specific config file + const char* config = + this->GetOption("CPACK_PROJECT_CONFIG_FILE"); + if(config) + { + mf->ReadListFile(config); + } int result = this->InitializeInternal(); if (cmSystemTools::GetErrorOccuredFlag()) { -- cgit v0.12