CPack single component packaging

RPM, DEB and archive packages were not created
in cases when CPACK_<generator>_COMPONENT_INSTALL
was set to ON and a single component existed.
Patch also changes CPackRPM test to implicitly
test for this case.
This commit is contained in:
Domen Vrankar 2015-04-05 22:49:19 +02:00
parent a3e2de3a31
commit 0ffd35340e
2 changed files with 4 additions and 2 deletions

View File

@ -1499,7 +1499,10 @@ bool cmCPackGenerator::SupportsComponentInstallation() const
//----------------------------------------------------------------------
bool cmCPackGenerator::WantsComponentInstallation() const
{
return (!IsOn("CPACK_MONOLITHIC_INSTALL") & SupportsComponentInstallation());
return (!IsOn("CPACK_MONOLITHIC_INSTALL")
&& SupportsComponentInstallation()
// check that package at least has components
&& !(this->ComponentGroups.empty() || this->Components.empty()));
}
//----------------------------------------------------------------------

View File

@ -1,5 +1,4 @@
install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static)
install(FILES CMakeLists.txt DESTINATION relocatable COMPONENT relocatable)
set(CPACK_PACKAGE_RELOCATABLE TRUE)
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt")