summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-03-30 18:33:48 (GMT)
committerBrad King <brad.king@kitware.com>2006-03-30 18:33:48 (GMT)
commit08b14163ee2cc9cced08d80b2c81b29c83072229 (patch)
treeaabd429ef1d4d93a39429f192e5b56b5b0feb6b4 /Source/cmLocalGenerator.cxx
parent3cf3fc510febc42af0db07c71c7c3925724b3201 (diff)
downloadCMake-08b14163ee2cc9cced08d80b2c81b29c83072229.zip
CMake-08b14163ee2cc9cced08d80b2c81b29c83072229.tar.gz
CMake-08b14163ee2cc9cced08d80b2c81b29c83072229.tar.bz2
ENH: Added named component installation implementation. Installation behavior should be unchanged unless -DCOMPONENT=<name> is specified when cmake_install.cmake is invoked.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx38
1 files changed, 32 insertions, 6 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4f98ffb..af82c45 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -329,6 +329,19 @@ void cmLocalGenerator::GenerateInstallRules()
"ENDIF(NOT CMAKE_INSTALL_CONFIG_NAME)\n"
"\n";
+ // Write support code for dealing with component-specific installs.
+ fout <<
+ "# Set the component getting installed.\n"
+ "IF(NOT CMAKE_INSTALL_COMPONENT)\n"
+ " IF(COMPONENT)\n"
+ " MESSAGE(STATUS \"Install component: \\\"${COMPONENT}\\\"\")\n"
+ " SET(CMAKE_INSTALL_COMPONENT \"${COMPONENT}\")\n"
+ " ELSE(COMPONENT)\n"
+ " SET(CMAKE_INSTALL_COMPONENT)\n"
+ " ENDIF(COMPONENT)\n"
+ "ENDIF(NOT CMAKE_INSTALL_COMPONENT)\n"
+ "\n";
+
// Ask each install generator to write its code.
std::vector<cmInstallGenerator*> const& installers =
this->Makefile->GetInstallGenerators();
@@ -358,10 +371,21 @@ void cmLocalGenerator::GenerateInstallRules()
// Record the install manifest.
if ( toplevel_install )
{
- fout << "FILE(WRITE \"" << homedir.c_str() << "/install_manifest.txt\" "
- << "\"\")" << std::endl;
- fout << "FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})" << std::endl
- << " FILE(APPEND \"" << homedir.c_str() << "/install_manifest.txt\" "
+ fout <<
+ "IF(CMAKE_INSTALL_COMPONENT)\n"
+ " SET(CMAKE_INSTALL_MANIFEST \"install_manifest_"
+ "${CMAKE_INSTALL_COMPONENT}.txt\")\n"
+ "ELSE(CMAKE_INSTALL_COMPONENT)\n"
+ " SET(CMAKE_INSTALL_MANIFEST \"install_manifest.txt\")\n"
+ "ENDIF(CMAKE_INSTALL_COMPONENT)\n";
+ fout
+ << "FILE(WRITE \""
+ << homedir.c_str() << "/${CMAKE_INSTALL_MANIFEST}\" "
+ << "\"\")" << std::endl;
+ fout
+ << "FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})" << std::endl
+ << " FILE(APPEND \""
+ << homedir.c_str() << "/${CMAKE_INSTALL_MANIFEST}\" "
<< "\"${file}\\n\")" << std::endl
<< "ENDFOREACH(file)" << std::endl;
}
@@ -1698,9 +1722,10 @@ cmLocalGenerator
// Use a file install generator.
const char* no_permissions = "";
const char* no_rename = "";
+ const char* no_component = "";
cmInstallFilesGenerator g(l->second.GetSourceLists(),
destination.c_str(), false,
- no_permissions, no_rename);
+ no_permissions, no_component, no_rename);
g.Generate(os, config, configurationTypes);
}
break;
@@ -1709,9 +1734,10 @@ cmLocalGenerator
// Use a file install generator.
const char* no_permissions = "";
const char* no_rename = "";
+ const char* no_component = "";
cmInstallFilesGenerator g(l->second.GetSourceLists(),
destination.c_str(), true,
- no_permissions, no_rename);
+ no_permissions, no_component, no_rename);
g.Generate(os, config, configurationTypes);
}
break;