summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-09-07 14:05:12 (GMT)
committerBrad King <brad.king@kitware.com>2006-09-07 14:05:12 (GMT)
commitd458764791002788f60f72f101b9735e4cf12424 (patch)
treecc067c59e60094396923c95991e45cdb9f0b5ddd /Source/cmInstallCommand.cxx
parent64231a20a234ad6a09ac851363f95d6c7a1145b8 (diff)
downloadCMake-d458764791002788f60f72f101b9735e4cf12424.zip
CMake-d458764791002788f60f72f101b9735e4cf12424.tar.gz
CMake-d458764791002788f60f72f101b9735e4cf12424.tar.bz2
ENH: Patch from Toni Timonen to allow cross-compiling of DLLs.
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r--Source/cmInstallCommand.cxx78
1 files changed, 43 insertions, 35 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 20081eb..506489e 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -367,6 +367,11 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
return false;
}
+ // Check whether this is a DLL platform.
+ bool dll_platform = (this->Makefile->IsOn("WIN32") ||
+ this->Makefile->IsOn("CYGWIN") ||
+ this->Makefile->IsOn("MINGW"));
+
// Compute destination paths.
std::string archive_dest;
std::string library_dest;
@@ -389,46 +394,49 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// platforms. All windows platforms are DLL platforms
// including cygwin. Currently no other platform is a DLL
// platform.
-#if defined(_WIN32) || defined(__CYGWIN__)
- // This is a DLL platform.
- if(archive_destination)
- {
- // The import library uses the ARCHIVE properties.
- this->Makefile->AddInstallGenerator(
- new cmInstallTargetGenerator(target, archive_dest.c_str(), true,
- archive_permissions.c_str(),
- archive_configurations,
- archive_component.c_str()));
- }
- if(runtime_destination)
- {
- // The DLL uses the RUNTIME properties.
- this->Makefile->AddInstallGenerator(
- new cmInstallTargetGenerator(target, runtime_dest.c_str(), false,
- runtime_permissions.c_str(),
- runtime_configurations,
- runtime_component.c_str()));
- }
-#else
- // This is a non-DLL platform.
- if(library_destination)
+ if(dll_platform)
{
- // The shared library uses the LIBRARY properties.
- this->Makefile->AddInstallGenerator(
- new cmInstallTargetGenerator(target, library_dest.c_str(), false,
- library_permissions.c_str(),
- library_configurations,
- library_component.c_str()));
+ // This is a DLL platform.
+ if(archive_destination)
+ {
+ // The import library uses the ARCHIVE properties.
+ this->Makefile->AddInstallGenerator(
+ new cmInstallTargetGenerator(target, archive_dest.c_str(), true,
+ archive_permissions.c_str(),
+ archive_configurations,
+ archive_component.c_str()));
+ }
+ if(runtime_destination)
+ {
+ // The DLL uses the RUNTIME properties.
+ this->Makefile->AddInstallGenerator(
+ new cmInstallTargetGenerator(target, runtime_dest.c_str(), false,
+ runtime_permissions.c_str(),
+ runtime_configurations,
+ runtime_component.c_str()));
+ }
}
else
{
- cmOStringStream e;
- e << "TARGETS given no LIBRARY DESTINATION for shared library "
- "target \"" << target.GetName() << "\".";
- this->SetError(e.str().c_str());
- return false;
+ // This is a non-DLL platform.
+ if(library_destination)
+ {
+ // The shared library uses the LIBRARY properties.
+ this->Makefile->AddInstallGenerator(
+ new cmInstallTargetGenerator(target, library_dest.c_str(), false,
+ library_permissions.c_str(),
+ library_configurations,
+ library_component.c_str()));
+ }
+ else
+ {
+ cmOStringStream e;
+ e << "TARGETS given no LIBRARY DESTINATION for shared library "
+ "target \"" << target.GetName() << "\".";
+ this->SetError(e.str().c_str());
+ return false;
+ }
}
-#endif
}
break;
case cmTarget::STATIC_LIBRARY: