diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-02-03 15:53:41 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-02-03 15:53:41 (GMT) |
commit | 038abb867e0d4276ff10b59a3e9388bcbb646525 (patch) | |
tree | 6159dee7aa5d91cd897cf7783b5f49be07050bcc /Source/cmFileCommand.cxx | |
parent | a721b9640732c60d282896cdf64691758ffe8bca (diff) | |
download | CMake-038abb867e0d4276ff10b59a3e9388bcbb646525.zip CMake-038abb867e0d4276ff10b59a3e9388bcbb646525.tar.gz CMake-038abb867e0d4276ff10b59a3e9388bcbb646525.tar.bz2 |
ENH: Add support for install postfix
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r-- | Source/cmFileCommand.cxx | 17 |
1 files changed, 16 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; |