summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-06-29 13:23:27 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-06-29 13:23:27 (GMT)
commit43d380e0d8c6458b7b729dbc8eab4f504960f9f9 (patch)
treee8378ac0343ed8aa6958059257d2832f1033d2bc /Source/cmFileCommand.cxx
parented0999c9d1c60bdb5be4354e068a95936819b996 (diff)
downloadCMake-43d380e0d8c6458b7b729dbc8eab4f504960f9f9.zip
CMake-43d380e0d8c6458b7b729dbc8eab4f504960f9f9.tar.gz
CMake-43d380e0d8c6458b7b729dbc8eab4f504960f9f9.tar.bz2
ENH: Better handling of debug postfix and fix the test
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index c178059..3a22e21 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -249,6 +249,15 @@ bool cmFileCommand::HandleInstallCommand(
std::string destination = "";
std::string stype = "FILES";
const char* build_type = m_Makefile->GetDefinition("BUILD_TYPE");
+ if ( build_type && strcmp(build_type, ".") == 0 )
+ {
+ build_type = 0;
+ }
+ if ( build_type && strncmp(build_type, ".\\", 2) == 0 )
+ {
+ build_type += 2;
+ }
+
const char* debug_postfix
= m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
const char* destdir = cmSystemTools::GetEnv("DESTDIR");
@@ -259,7 +268,7 @@ bool cmFileCommand::HandleInstallCommand(
{
extra_dir = build_type;
std::string btype = cmSystemTools::LowerCase(build_type);
- if ( btype == "debug" )
+ if ( strncmp(btype.c_str(), "debug", strlen("debug")) == 0 )
{
debug = 1;
}
@@ -441,13 +450,19 @@ bool cmFileCommand::HandleInstallCommand(
for ( i = 0; i < files.size(); i ++ )
{
- std::string destfile
- = destination + "/" + cmSystemTools::GetFilenameName(files[i]);
+ std::string destfilewe
+ = destination + "/"
+ + cmSystemTools::GetFilenameWithoutExtension(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);
+ std::string destfile = destfilewe;
+ if ( ext.size() )
+ {
+ destfile + "." + ext;
+ }
switch( itype )
{
case cmTarget::MODULE_LIBRARY:
@@ -456,6 +471,7 @@ bool cmFileCommand::HandleInstallCommand(
if ( debug )
{
fname = fnamewe + debug_postfix + ext;
+ destfile = destfilewe + debug_postfix + ext;
}
{
// Handle shared library versioning
@@ -564,7 +580,7 @@ bool cmFileCommand::HandleInstallCommand(
) )
{
cmOStringStream err;
- err << "Program setting permissions on file: " << destfile.c_str();
+ err << "Problem setting permissions on file: " << destfile.c_str();
perror(err.str().c_str());
}
}