summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
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";