summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 1ad42ca..c151ea4 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1309,10 +1309,13 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
{
depends.push_back("preinstall");
}
- (*targets)[this->GetPackageTargetName()]
- = this->CreateGlobalTarget(this->GetPackageTargetName(),
- "Run CPack packaging tool...", &cpackCommandLines, depends);
-
+ if(cmSystemTools::FileExists(configFile.c_str()))
+ {
+ (*targets)[this->GetPackageTargetName()]
+ = this->CreateGlobalTarget(this->GetPackageTargetName(),
+ "Run CPack packaging tool...",
+ &cpackCommandLines, depends);
+ }
// CPack source
const char* packageSourceTargetName = this->GetPackageSourceTargetName();
if ( packageSourceTargetName )
@@ -1324,11 +1327,15 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
singleLine.push_back("--config");
configFile = mf->GetStartOutputDirectory();;
configFile += "/CPackSourceConfig.cmake";
- singleLine.push_back(configFile);
- cpackCommandLines.push_back(singleLine);
- (*targets)[packageSourceTargetName]
- = this->CreateGlobalTarget(packageSourceTargetName,
- "Run CPack packaging tool for source...", &cpackCommandLines, depends);
+ if(cmSystemTools::FileExists(configFile.c_str()))
+ {
+ singleLine.push_back(configFile);
+ cpackCommandLines.push_back(singleLine);
+ (*targets)[packageSourceTargetName]
+ = this->CreateGlobalTarget(packageSourceTargetName,
+ "Run CPack packaging tool for source...",
+ &cpackCommandLines, depends);
+ }
}
// Test