summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-04-17 20:06:31 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-04-17 20:06:31 (GMT)
commit71b370c79c741f9399d9ea85b854e5c13f889a2d (patch)
tree1925136c96ef61c44b60528d0d35fe2882bb75de /Source/cmGlobalGenerator.cxx
parentd71f723b11b8e8f6ab048b42548d29c2e3baef5f (diff)
downloadCMake-71b370c79c741f9399d9ea85b854e5c13f889a2d.zip
CMake-71b370c79c741f9399d9ea85b854e5c13f889a2d.tar.gz
CMake-71b370c79c741f9399d9ea85b854e5c13f889a2d.tar.bz2
BUG: Verify the global target name exists before using it. Fixes VS and Xcode
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx30
1 files changed, 17 insertions, 13 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b44c44f..1ad42ca 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1313,19 +1313,23 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
= this->CreateGlobalTarget(this->GetPackageTargetName(),
"Run CPack packaging tool...", &cpackCommandLines, depends);
- // CPack
- cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
- singleLine.erase(singleLine.begin(), singleLine.end());
- depends.erase(depends.begin(), depends.end());
- singleLine.push_back(this->GetCMakeInstance()->GetCPackCommand());
- singleLine.push_back("--config");
- configFile = mf->GetStartOutputDirectory();;
- configFile += "/CPackSourceConfig.cmake";
- singleLine.push_back(configFile);
- cpackCommandLines.push_back(singleLine);
- (*targets)[this->GetPackageSourceTargetName()]
- = this->CreateGlobalTarget(this->GetPackageSourceTargetName(),
- "Run CPack packaging tool for source...", &cpackCommandLines, depends);
+ // CPack source
+ const char* packageSourceTargetName = this->GetPackageSourceTargetName();
+ if ( packageSourceTargetName )
+ {
+ cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
+ singleLine.erase(singleLine.begin(), singleLine.end());
+ depends.erase(depends.begin(), depends.end());
+ singleLine.push_back(this->GetCMakeInstance()->GetCPackCommand());
+ 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);
+ }
// Test
if(mf->IsOn("CMAKE_TESTING_ENABLED"))