diff options
-rw-r--r-- | Source/cmFileCommand.cxx | 17 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmSetCommand.h | 5 |
3 files changed, 28 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 404c941..82a70ca 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -238,10 +238,18 @@ bool cmFileCommand::HandleInstallCommand(std::vector<std::string> const& args) std::string destination = ""; std::string stype = "FILES"; const char* build_type = m_Makefile->GetDefinition("BUILD_TYPE"); + const char* debug_postfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"); std::string extra_dir = ""; + int debug = 0; if ( build_type ) { extra_dir = build_type; + std::string btype = build_type; + cmSystemTools::LowerCase(btype); + if ( btype == "debug" ) + { + debug = 1; + } } @@ -341,17 +349,24 @@ bool cmFileCommand::HandleInstallCommand(std::vector<std::string> const& args) { std::string destfile = destination + "/" + cmSystemTools::GetFilenameName(files[i]); std::string ctarget = files[i].c_str(); + std::string fname = cmSystemTools::GetFilenameName(ctarget); + std::string ext = cmSystemTools::GetFilenameExtension(ctarget); + std::string fnamewe = cmSystemTools::GetFilenameWithoutExtension(ctarget); switch( itype ) { case cmTarget::MODULE_LIBRARY: case cmTarget::STATIC_LIBRARY: case cmTarget::SHARED_LIBRARY: + if ( debug ) + { + fname = fnamewe + debug_postfix + "." + ext; + } case cmTarget::EXECUTABLE: if ( extra_dir.size() > 0 ) { cmOStringStream str; str << cmSystemTools::GetFilenamePath(ctarget) << "/" << extra_dir << "/" - << cmSystemTools::GetFilenameName(ctarget); + << fname; ctarget = str.str(); } break; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4c8262e..1e23d31 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -83,6 +83,13 @@ void cmLocalGenerator::GenerateInstallRules() fout << "# Install script for directory: " << m_Makefile->GetCurrentDirectory() << std::endl << std::endl; + const char* cmakeDebugPosfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"); + if ( cmakeDebugPosfix ) + { + fout << "SET(CMAKE_DEBUG_POSTFIX \"" << cmakeDebugPosfix << "\")" + << std::endl << std::endl; + } + std::string libOutPath = ""; if (m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH")) { diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h index c7d1555..b168be0 100644 --- a/Source/cmSetCommand.h +++ b/Source/cmSetCommand.h @@ -48,6 +48,11 @@ public: virtual bool IsInherited() {return true;} /** + * This determines if the command is invoked when in script mode. + */ + virtual bool IsScriptable() { return true; } + + /** * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() {return "SET";} |