summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake3
-rw-r--r--CMakeCPackOptions.cmake.in (renamed from CPackConfig.cmake.in)9
-rw-r--r--CPackSourceConfig.cmake.in8
-rw-r--r--Source/CPack/cmCPackGenericGenerator.cxx10
4 files changed, 18 insertions, 12 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index b988d178a1..f511895d35 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/CPackConfig.cmake.in b/CMakeCPackOptions.cmake.in
index 6c92d0c122..f1be2e87ed 100644
--- a/CPackConfig.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -1,6 +1,3 @@
-# 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.
@@ -31,3 +28,9 @@ if(CPACK_GENERATOR MATCHES "NSIS")
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/CPackSourceConfig.cmake.in b/CPackSourceConfig.cmake.in
deleted file mode 100644
index 46b8eee7dc..0000000000
--- 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 e961357f55..51d1018399 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())
{