diff options
author | Brad King <brad.king@kitware.com> | 2006-08-29 14:03:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-08-29 14:03:47 (GMT) |
commit | eef327b944a590373faa8df4eca7dbf0387c6f5c (patch) | |
tree | 736c79794fbc57142854c6855bcb6da92b4bd281 | |
parent | 8a761b8f96942fe586bb932fbe840a4679a35705 (diff) | |
download | CMake-eef327b944a590373faa8df4eca7dbf0387c6f5c.zip CMake-eef327b944a590373faa8df4eca7dbf0387c6f5c.tar.gz CMake-eef327b944a590373faa8df4eca7dbf0387c6f5c.tar.bz2 |
ENH: Adding install/local global target for Makefile generators. This runs installation only in the current directory and not subdirectories.
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.h | 1 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 2 |
5 files changed, 21 insertions, 3 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 0f4d13e..35bc3b7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1495,6 +1495,20 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) this->CreateGlobalTarget( this->GetInstallTargetName(), "Install the project...", &cpackCommandLines, depends); + + // install_local + if(const char* install_local = this->GetInstallLocalTargetName()) + { + singleLine.insert(singleLine.begin()+1, "-DCMAKE_INSTALL_LOCAL_ONLY=1"); + cpackCommandLines.erase(cpackCommandLines.begin(), + cpackCommandLines.end()); + cpackCommandLines.push_back(singleLine); + + (*targets)[install_local] = + this->CreateGlobalTarget( + install_local, "Installing only the local directory...", + &cpackCommandLines, depends); + } } cmTarget cmGlobalGenerator::CreateGlobalTarget( diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 07ee8d8..b4ef86f 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -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* GetPreinstallTargetName() { return 0; } virtual const char* GetTestTargetName() { return "RUN_TESTS"; } virtual const char* GetPackageTargetName() { return "PACKAGE"; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index a006808..9e78f7a 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -159,6 +159,7 @@ protected: // Setup target names virtual const char* GetAllTargetName() { return "all"; } virtual const char* GetInstallTargetName() { return "install"; } + virtual const char* GetInstallLocalTargetName() { return "install/local"; } virtual const char* GetPreinstallTargetName() { return "preinstall"; } virtual const char* GetTestTargetName() { return "test"; } virtual const char* GetPackageTargetName() { return "package"; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a251ee2..e1d25b5 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -397,7 +397,8 @@ void cmLocalGenerator::GenerateInstallRules() // Include install scripts from subdirectories. if(!this->Children.empty()) { - fout << "# Include the install script for each subdirectory.\n"; + fout << "IF(NOT CMAKE_INSTALL_LOCAL_ONLY)\n"; + fout << " # Include the install script for each subdirectory.\n"; for(std::vector<cmLocalGenerator*>::const_iterator ci = this->Children.begin(); ci != this->Children.end(); ++ci) { @@ -405,11 +406,12 @@ void cmLocalGenerator::GenerateInstallRules() { std::string odir = (*ci)->GetMakefile()->GetStartOutputDirectory(); cmSystemTools::ConvertToUnixSlashes(odir); - fout << "INCLUDE(\"" << odir.c_str() + fout << " INCLUDE(\"" << odir.c_str() << "/cmake_install.cmake\")" << std::endl; } } fout << "\n"; + fout << "ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)\n"; } // Record the install manifest. diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index c082625..dd706a4 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1481,7 +1481,7 @@ void cmLocalUnixMakefileGenerator3 // Provide a "/fast" version of the target. depends.clear(); - if(targetName == "install") + if((targetName == "install") || (targetName == "install_local")) { // Provide a fast install target that does not depend on all // but has the same command. |