diff options
author | Brad King <brad.king@kitware.com> | 2006-03-30 18:33:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-03-30 18:33:48 (GMT) |
commit | 08b14163ee2cc9cced08d80b2c81b29c83072229 (patch) | |
tree | aabd429ef1d4d93a39429f192e5b56b5b0feb6b4 /Source/cmInstallTargetGenerator.cxx | |
parent | 3cf3fc510febc42af0db07c71c7c3925724b3201 (diff) | |
download | CMake-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/cmInstallTargetGenerator.cxx')
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 90b14a4..690904a 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -24,9 +24,9 @@ //---------------------------------------------------------------------------- cmInstallTargetGenerator ::cmInstallTargetGenerator(cmTarget& t, const char* dest, bool implib, - const char* permissions): + const char* permissions, const char* component): Target(&t), Destination(dest), ImportLibrary(implib), - Permissions(permissions) + Permissions(permissions), Component(component) { this->Target->SetHaveInstallRule(true); } @@ -145,7 +145,7 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) // Write code to install the target file. this->AddInstallRule(os, destination.c_str(), type, fromFile.c_str(), this->ImportLibrary, properties, - this->Permissions.c_str()); + this->Permissions.c_str(), this->Component.c_str()); // Fix the install_name settings in installed binaries. if(type == cmTarget::SHARED_LIBRARY || @@ -335,18 +335,24 @@ void cmInstallTargetGenerator::AddInstallNamePatchRule(std::ostream& os, // install_name value and references. if(!new_id.empty() || !install_name_remap.empty()) { - os << "EXECUTE_PROCESS(COMMAND install_name_tool"; + std::string component_test = + "NOT CMAKE_INSTALL_COMPONENT OR \"${CMAKE_INSTALL_COMPONENT}\" MATCHES \"^("; + component_test += this->Component; + component_test += ")$\""; + os << "IF(" << component_test << ")\n"; + os << " EXECUTE_PROCESS(COMMAND install_name_tool"; if(!new_id.empty()) { - os << "\n -id \"" << new_id << "\""; + os << "\n -id \"" << new_id << "\""; } for(std::map<cmStdString, cmStdString>::const_iterator i = install_name_remap.begin(); i != install_name_remap.end(); ++i) { - os << "\n -change \"" << i->first << "\" \"" << i->second << "\""; + os << "\n -change \"" << i->first << "\" \"" << i->second << "\""; } - os << "\n \"" << destination << "/" + os << "\n \"" << destination << "/" << this->GetScriptReference(this->Target, "REMAPPED", true) << "\")\n"; + os << "ENDIF(" << component_test << ")\n"; } } |