summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-02-27 16:26:38 (GMT)
committerBrad King <brad.king@kitware.com>2012-02-27 18:19:57 (GMT)
commit573fa3bf136e5c780d3dd7e2dc692d52b3eba96d (patch)
tree532b26ed0e999b0c6a061d970abf37139a161588 /Source/cmInstallTargetGenerator.cxx
parentcffebe643c9002ee3411c8f293abdf7c23fc622c (diff)
downloadCMake-573fa3bf136e5c780d3dd7e2dc692d52b3eba96d.zip
CMake-573fa3bf136e5c780d3dd7e2dc692d52b3eba96d.tar.gz
CMake-573fa3bf136e5c780d3dd7e2dc692d52b3eba96d.tar.bz2
Factor cmInstallType out of cmTarget::TargetType
The purpose of the TargetType enumeration was overloaded for install type because install rules were once recorded as targets. Factor the install types out into their own enumeration.
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r--Source/cmInstallTargetGenerator.cxx26
1 files changed, 20 insertions, 6 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index ac1c949..c74dda0 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -82,8 +82,22 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
std::vector<std::string> filesFrom;
std::vector<std::string> filesTo;
std::string literal_args;
- cmTarget::TargetType type = this->Target->GetType();
- if(type == cmTarget::EXECUTABLE)
+ cmTarget::TargetType targetType = this->Target->GetType();
+ cmInstallType type = cmInstallType();
+ switch(targetType)
+ {
+ case cmTarget::EXECUTABLE: type = cmInstallType_EXECUTABLE; break;
+ case cmTarget::STATIC_LIBRARY: type = cmInstallType_STATIC_LIBRARY; break;
+ case cmTarget::SHARED_LIBRARY: type = cmInstallType_SHARED_LIBRARY; break;
+ case cmTarget::MODULE_LIBRARY: type = cmInstallType_MODULE_LIBRARY; break;
+ case cmTarget::UTILITY:
+ case cmTarget::GLOBAL_TARGET:
+ case cmTarget::UNKNOWN_LIBRARY:
+ this->Target->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR,
+ "cmInstallTargetGenerator created with non-installable target.");
+ return;
+ }
+ if(targetType == cmTarget::EXECUTABLE)
{
// There is a bug in cmInstallCommand if this fails.
assert(this->NamelinkMode == NamelinkModeNone);
@@ -110,7 +124,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
}
// An import library looks like a static library.
- type = cmTarget::STATIC_LIBRARY;
+ type = cmInstallType_STATIC_LIBRARY;
}
else
{
@@ -121,7 +135,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
if(this->Target->IsAppBundleOnApple())
{
// Install the whole app bundle directory.
- type = cmTarget::INSTALL_DIRECTORY;
+ type = cmInstallType_DIRECTORY;
literal_args += " USE_SOURCE_PERMISSIONS";
from1 += ".app";
@@ -173,7 +187,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
}
// An import library looks like a static library.
- type = cmTarget::STATIC_LIBRARY;
+ type = cmInstallType_STATIC_LIBRARY;
}
else if(this->Target->IsFrameworkOnApple())
{
@@ -181,7 +195,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
assert(this->NamelinkMode == NamelinkModeNone);
// Install the whole framework directory.
- type = cmTarget::INSTALL_DIRECTORY;
+ type = cmInstallType_DIRECTORY;
literal_args += " USE_SOURCE_PERMISSIONS";
std::string from1 = fromDirConfig + targetName + ".framework";