ENH: add install/strip target for makefile generators if strip was found

Alex
This commit is contained in:
Alexander Neundorf 2007-05-18 13:43:39 -04:00
parent a18d286635
commit df8f550029
4 changed files with 26 additions and 3 deletions

View File

@ -1440,16 +1440,35 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
// install_local
if(const char* install_local = this->GetInstallLocalTargetName())
{
singleLine.insert(singleLine.begin()+1, "-DCMAKE_INSTALL_LOCAL_ONLY=1");
cmCustomCommandLine localCmdLine = singleLine;
localCmdLine.insert(localCmdLine.begin()+1, "-DCMAKE_INSTALL_LOCAL_ONLY=1");
cpackCommandLines.erase(cpackCommandLines.begin(),
cpackCommandLines.end());
cpackCommandLines.push_back(singleLine);
cpackCommandLines.push_back(localCmdLine);
(*targets)[install_local] =
this->CreateGlobalTarget(
install_local, "Installing only the local directory...",
&cpackCommandLines, depends);
}
// install_strip
const char* install_strip = this->GetInstallStripTargetName();
if((install_strip !=0) && (mf->IsSet("CMAKE_STRIP")))
{
cmCustomCommandLine stripCmdLine = singleLine;
stripCmdLine.insert(stripCmdLine.begin()+1,"-DCMAKE_INSTALL_DO_STRIP=1");
cpackCommandLines.erase(cpackCommandLines.begin(),
cpackCommandLines.end());
cpackCommandLines.push_back(stripCmdLine);
(*targets)[install_strip] =
this->CreateGlobalTarget(
install_strip, "Installing the project stripped...",
&cpackCommandLines, depends);
}
}
}

View File

@ -186,6 +186,7 @@ public:
virtual const char* GetAllTargetName() { return "ALL_BUILD"; }
virtual const char* GetInstallTargetName() { return "INSTALL"; }
virtual const char* GetInstallLocalTargetName() { return 0; }
virtual const char* GetInstallStripTargetName() { return 0; }
virtual const char* GetPreinstallTargetName() { return 0; }
virtual const char* GetTestTargetName() { return "RUN_TESTS"; }
virtual const char* GetPackageTargetName() { return "PACKAGE"; }

View File

@ -161,6 +161,7 @@ protected:
virtual const char* GetAllTargetName() { return "all"; }
virtual const char* GetInstallTargetName() { return "install"; }
virtual const char* GetInstallLocalTargetName() { return "install/local"; }
virtual const char* GetInstallStripTargetName() { return "install/strip"; }
virtual const char* GetPreinstallTargetName() { return "preinstall"; }
virtual const char* GetTestTargetName() { return "test"; }
virtual const char* GetPackageTargetName() { return "package"; }

View File

@ -1456,7 +1456,9 @@ void cmLocalUnixMakefileGenerator3
// Provide a "/fast" version of the target.
depends.clear();
if((targetName == "install") || (targetName == "install_local"))
if((targetName == "install")
|| (targetName == "install_local")
|| (targetName == "install_strip"))
{
// Provide a fast install target that does not depend on all
// but has the same command.