summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-04-14 12:58:13 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-04-14 12:58:13 (GMT)
commitc836be6f7bf92f209adfa1673a8252937ed8e537 (patch)
treeb0377588bfbdc2f4e0a9d0a58aa30b04a0df32c0
parent0adee1e6dd4f62bd64ff939f51ac75a07ac9c728 (diff)
downloadCMake-c836be6f7bf92f209adfa1673a8252937ed8e537.zip
CMake-c836be6f7bf92f209adfa1673a8252937ed8e537.tar.gz
CMake-c836be6f7bf92f209adfa1673a8252937ed8e537.tar.bz2
ENH: Start adding support for packaging component and to package into a subdirectory
-rw-r--r--Modules/CPack.cmake2
-rw-r--r--Source/CPack/cmCPackGenericGenerator.cxx16
-rw-r--r--Templates/CPackConfig.cmake.in5
3 files changed, 21 insertions, 2 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 86eca58..06313c7 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -69,7 +69,7 @@ ENDIF(NOT CPACK_GENERATOR)
# Set some other variables
cpack_set_if_not_set(CPACK_BINARY_DIR "${CMAKE_BINARY_DIR}")
cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
- "${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME}")
+ "${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
SET(_CPACK_UNUSED_VARIABLES_)
diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx
index 7669c5f..a26f1e2 100644
--- a/Source/CPack/cmCPackGenericGenerator.cxx
+++ b/Source/CPack/cmCPackGenericGenerator.cxx
@@ -252,9 +252,25 @@ int cmCPackGenericGenerator::InstallProject()
it != cmakeProjectsVector.end();
++it )
{
+ if ( it+1 == cmakeProjectsVector.end() ||
+ it+2 == cmakeProjectsVector.end() ||
+ it+3 == cmakeProjectsVector.end() )
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Not enough items on list: CPACK_INSTALL_CMAKE_PROJECTS. "
+ "CPACK_INSTALL_CMAKE_PROJECTS should hold quadruplet of install "
+ "directory, install project name, install component, and install "
+ "subdirectory."
+ << std::endl);
+ return 0;
+ }
std::string installDirectory = it->c_str();
++it;
std::string installProjectName = it->c_str();
+ ++it;
+ std::string installComponent = it->c_str();
+ ++it;
+ std::string installSubDirectory = it->c_str();
std::string installFile = installDirectory + "/cmake_install.cmake";
const char* buildConfig = this->GetOption("CPACK_BUILD_CONFIG");
diff --git a/Templates/CPackConfig.cmake.in b/Templates/CPackConfig.cmake.in
index 0f4ecd0..0406392 100644
--- a/Templates/CPackConfig.cmake.in
+++ b/Templates/CPackConfig.cmake.in
@@ -1,8 +1,11 @@
# This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. Example variables are:
-# CPACK_BINARY_DIR - Path to the build tree
# CPACK_GENERATOR - Generator used to create package
+# CPACK_INSTALL_CMAKE_PROJECTS - For each project (path, name, component)
+# CPACK_CMAKE_GENERATOR - CMake Generator used for the projects
+# CPACK_INSTALL_COMMANDS - Extra commands to install components
+# CPACK_INSTALL_DIRECTORIES - Extra directories to install
# CPACK_PACKAGE_DESCRIPTION_FILE - Description file for the package
# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Summary of the package
# CPACK_PACKAGE_EXECUTABLES - List of pairs of executables and labels