Commit 805c1b21 authored by Eric Noulard's avatar Eric Noulard
Browse files

Handle CPACK_MONOLITHIC_INSTALL in some rare use cases.

For example, when CPACK_<GEN>_COMPONENT_INSTALL and
CPACK_MONOLITHIC_INSTALL are both set. Previously, this
combination of variable settings produced an error without
any explanation. Now, in this case CPACK_MONOLITHIC_INSTALL wins
without trouble.
This is useful for when e.g. CPACK_ARCHIVE_COMPONENT_INSTALL is
globally on and one wants MONOLITHIC install for STGZ (but not
other generators). The same behavior may be obtained by re-setting
CPACK_ARCHIVE_COMPONENT_INSTALL to 0 but in any case the
'both set' case should have been handled without error.
parent 1bfe81e0
......@@ -247,7 +247,7 @@ int cmCPackArchiveGenerator::PackageFiles()
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: "
<< toplevel << std::endl);
if (SupportsComponentInstallation()) {
if (WantsComponentInstallation()) {
// CASE 1 : COMPONENT ALL-IN-ONE package
// If ALL COMPONENTS in ONE package has been requested
// then the package file is unique and should be open here.
......
......@@ -236,7 +236,7 @@ int cmCPackDebGenerator::PackageFiles()
int retval = -1;
/* Are we in the component packaging case */
if (SupportsComponentInstallation()) {
if (WantsComponentInstallation()) {
// CASE 1 : COMPONENT ALL-IN-ONE package
// If ALL GROUPS or ALL COMPONENTS in ONE package has been requested
// then the package file is unique and should be open here.
......
......@@ -1436,6 +1436,12 @@ bool cmCPackGenerator::SupportsComponentInstallation() const
return false;
}
//----------------------------------------------------------------------
bool cmCPackGenerator::WantsComponentInstallation() const
{
return (!IsOn("CPACK_MONOLITHIC_INSTALL") & SupportsComponentInstallation());
}
//----------------------------------------------------------------------
cmCPackInstallationType*
cmCPackGenerator::GetInstallationType(const char *projectName,
......
......@@ -189,7 +189,21 @@ protected:
virtual int InstallProjectViaInstallCMakeProjects(
bool setDestDir, const char* tempInstallDirectory);
/**
* Does the CPack generator support component installation?.
* Some Generators requires the user to set
* CPACK_<GENNAME>_COMPONENT_INSTALL in order to make this
* method return true.
* @return true if supported, false otherwise
*/
virtual bool SupportsComponentInstallation() const;
/**
* Does the currently running generator want a component installation.
* The generator may support component installation but he may
* be requiring monolithic install using CPACK_MONOLITHIC_INSTALL.
* @return true if component installation is supported and wanted.
*/
virtual bool WantsComponentInstallation() const;
virtual cmCPackInstallationType* GetInstallationType(const char *projectName,
const char* name);
virtual cmCPackComponent* GetComponent(const char *projectName,
......
......@@ -201,7 +201,7 @@ int cmCPackRPMGenerator::PackageFiles()
<< toplevel << std::endl);
/* Are we in the component packaging case */
if (SupportsComponentInstallation()) {
if (WantsComponentInstallation()) {
// CASE 1 : COMPONENT ALL-IN-ONE package
// If ALL COMPONENTS in ONE package has been requested
// then the package file is unique and should be open here.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment