diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-01-27 17:37:30 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-01-27 17:37:30 (GMT) |
commit | d13e30f3ae02444682a2e593768020b9d11b6b54 (patch) | |
tree | 1bda720a9a8f0c993a5f6c848c9328c0e455d6ef /Source/cmLocalGenerator.cxx | |
parent | 127872e820ea7aed784c780d29f824817193c14e (diff) | |
download | CMake-d13e30f3ae02444682a2e593768020b9d11b6b54.zip CMake-d13e30f3ae02444682a2e593768020b9d11b6b54.tar.gz CMake-d13e30f3ae02444682a2e593768020b9d11b6b54.tar.bz2 |
ENH: Make install on windows seems to work now
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0a19def..5ad32cb 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -127,13 +127,38 @@ void cmLocalGenerator::GenerateInstallRules() switch (type) { case cmTarget::STATIC_LIBRARY: - case cmTarget::SHARED_LIBRARY: case cmTarget::MODULE_LIBRARY: fname = libOutPath; fname += this->GetFullTargetName(l->first.c_str(), l->second); files = fname.c_str(); this->AddInstallRule(fout, dest, type, files); break; + case cmTarget::SHARED_LIBRARY: + { + // Special code to handle DLL + fname = libOutPath; + fname += this->GetFullTargetName(l->first.c_str(), l->second); + std::string ext = cmSystemTools::GetFilenameExtension(fname); + ext = cmSystemTools::LowerCase(ext); + if ( ext == ".dll" ) + { + std::string libname = libOutPath; + libname += cmSystemTools::GetFilenameWithoutExtension(fname); + libname += ".lib"; + std::cout << "This is dll: " << libname << std::endl; + files = libname.c_str(); + this->AddInstallRule(fout, dest, cmTarget::STATIC_LIBRARY, files, true); + std::string dlldest = prefix + l->second.GetRuntimeInstallPath(); + files = fname.c_str(); + this->AddInstallRule(fout, dlldest.c_str(), type, files); + } + else + { + files = fname.c_str(); + this->AddInstallRule(fout, dest, type, files); + } + } + break; case cmTarget::WIN32_EXECUTABLE: case cmTarget::EXECUTABLE: fname = exeOutPath; @@ -213,14 +238,15 @@ void cmLocalGenerator::GenerateInstallRules() } } -void cmLocalGenerator::AddInstallRule(std::ostream& fout, const char* dest, int type, const char* files) +void cmLocalGenerator::AddInstallRule(std::ostream& fout, const char* dest, + int type, const char* files, bool optional) { std::string sfiles = files; std::string destination = dest; std::string stype; switch ( type ) { - case cmTarget::INSTALL_PROGRAMS: + case cmTarget::INSTALL_PROGRAMS: stype = "PROGRAM"; break; case cmTarget::EXECUTABLE: case cmTarget::WIN32_EXECUTABLE: stype = "EXECUTABLE"; break; case cmTarget::STATIC_LIBRARY: stype = "STATIC_LIBRARY"; break; @@ -232,7 +258,8 @@ void cmLocalGenerator::AddInstallRule(std::ostream& fout, const char* dest, int fout << "MESSAGE(STATUS \"Install " << stype << ": " << sfiles.c_str() << "\")\n" << "FILE(INSTALL DESTINATION \"" << destination.c_str() - << "\" TYPE " << stype.c_str() << " FILES \"" << sfiles.c_str() << "\")\n"; + << "\" TYPE " << stype.c_str() << (optional?" OPTIONAL":"") + << " FILES \"" << sfiles.c_str() << "\")\n"; } const char* cmLocalGenerator::GetSafeDefinition(const char* def) |