From 1e608c912cf5f5f61f7fd8d66000549aa9621b88 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Mon, 17 Apr 2006 15:26:54 -0400 Subject: ENH: Add packaging of source code (make package_source) --- Source/cmGlobalGenerator.cxx | 14 ++++++++++++++ Source/cmGlobalGenerator.h | 1 + Source/cmGlobalUnixMakefileGenerator3.h | 1 + 3 files changed, 16 insertions(+) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 79181cc..b44c44f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1313,6 +1313,20 @@ 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); + // Test if(mf->IsOn("CMAKE_TESTING_ENABLED")) { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 66a35a8..9325107 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -185,6 +185,7 @@ public: virtual const char* GetPreinstallTargetName() { return 0; } virtual const char* GetTestTargetName() { return "RUN_TESTS"; } virtual const char* GetPackageTargetName() { return "PACKAGE"; } + virtual const char* GetPackageSourceTargetName(){ return 0; } virtual const char* GetEditCacheTargetName() { return 0; } virtual const char* GetRebuildCacheTargetName() { return 0; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 6ad6ec9..76bc011 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -144,6 +144,7 @@ protected: virtual const char* GetPreinstallTargetName() { return "preinstall"; } virtual const char* GetTestTargetName() { return "test"; } virtual const char* GetPackageTargetName() { return "package"; } + virtual const char* GetPackageSourceTargetName(){ return "package_source"; } virtual const char* GetEditCacheTargetName() { return "edit_cache"; } virtual const char* GetRebuildCacheTargetName() { return "rebuild_cache"; } -- cgit v0.12