summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-04-19 18:08:13 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-04-19 18:08:13 (GMT)
commitbf238d6f0ef39b474e68b84e3964deaf3653aa72 (patch)
treea9bea6ad30640970d1a0d6a8e065664c93121d1d
parentf393d8c2f8b341ee3911e04ff70ff42b42a7c83a (diff)
parentd3fd945900f1fc09816cb59745c2fb241fa9b36c (diff)
downloadCMake-bf238d6f0ef39b474e68b84e3964deaf3653aa72.zip
CMake-bf238d6f0ef39b474e68b84e3964deaf3653aa72.tar.gz
CMake-bf238d6f0ef39b474e68b84e3964deaf3653aa72.tar.bz2
Merge topic 'CPackRPM-fix12096'
d3fd945 CPackRPM Fix #12096: handle absolute install path with component install
-rw-r--r--Modules/CPackRPM.cmake14
-rw-r--r--Source/CPack/cmCPackGenerator.cxx22
2 files changed, 36 insertions, 0 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 26209a7..d9d074c 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -495,6 +495,20 @@ EXECUTE_PROCESS(COMMAND find -type f -o -type l
WORKING_DIRECTORY "${WDIR}"
OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
+# In component case, replace CPACK_ABSOLUTE_DESTINATION_FILES
+# with the content of CPACK_ABSOLUTE_DESTINATION_FILES_<COMPONENT>
+# This must be done BEFORE the CPACK_ABSOLUTE_DESTINATION_FILES handling
+if(CPACK_RPM_PACKAGE_COMPONENT)
+ if(CPACK_ABSOLUTE_DESTINATION_FILES)
+ set(COMPONENT_FILES_TAG "CPACK_ABSOLUTE_DESTINATION_FILES_${CPACK_RPM_PACKAGE_COMPONENT}")
+ set(CPACK_ABSOLUTE_DESTINATION_FILES "${${COMPONENT_FILES_TAG}}")
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: Handling Absolute Destination Files ${CPACK_ABSOLUTE_DESTINATION_FILES}")
+ message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
+ endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
+endif()
+
if (CPACK_ABSOLUTE_DESTINATION_FILES)
IF(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES}")
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index c8a77d1..7e5b26d 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -867,6 +867,28 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Got some ABSOLUTE DESTINATION FILES: "
<< absoluteDestFiles << std::endl);
+ // define component specific var
+ if (componentInstall)
+ {
+ std::string absoluteDestFileComponent =
+ std::string("CPACK_ABSOLUTE_DESTINATION_FILES")
+ + "_" + GetComponentInstallDirNameSuffix(installComponent);
+ if (NULL != this->GetOption(absoluteDestFileComponent.c_str()))
+ {
+ std::string absoluteDestFilesListComponent =
+ this->GetOption(absoluteDestFileComponent.c_str());
+ absoluteDestFilesListComponent +=";";
+ absoluteDestFilesListComponent +=
+ mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES");
+ this->SetOption(absoluteDestFileComponent.c_str(),
+ absoluteDestFilesListComponent.c_str());
+ }
+ else
+ {
+ this->SetOption(absoluteDestFileComponent.c_str(),
+ mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES"));
+ }
+ }
}
if ( cmSystemTools::GetErrorOccuredFlag() || !res )
{