summaryrefslogtreecommitdiff
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-08-19 17:57:36 -0400
committerBrad King <brad.king@kitware.com>2005-08-19 17:57:36 -0400
commit05e6c3f3ba03bf33e860feff3392e3a21e4d3b2e (patch)
treee7ab126fcbbd06797074ec4ef233f05105c6279f /Source/cmLocalVisualStudio6Generator.cxx
parent98e51196642d384336b08461ca56eb7c651a9eb0 (diff)
downloadcmake-05e6c3f3ba03bf33e860feff3392e3a21e4d3b2e.tar.gz
BUG: Fixed OUTPUT_NAME feature for VS6 generator. It was not working for Debug builds and was not paying attention to the executable output path.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index bc60b27e81..ec81861f3d 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -964,20 +964,24 @@ void cmLocalVisualStudio6Generator
}
}
}
+ std::string outputName = "(OUTPUT_NAME is for executables only)";
std::string extraLinkOptions;
if(target.GetType() == cmTarget::EXECUTABLE)
{
extraLinkOptions =
m_Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS");
-
- // if the executable has an output name then add the appropriate flag
- if (target.GetProperty("OUTPUT_NAME"))
+ // Use the OUTPUT_NAME property if it was set. This is supported
+ // only for executables.
+ if(const char* outName = target.GetProperty("OUTPUT_NAME"))
{
- libMultiLineOptions += "# ADD LINK32 /out:";
- libMultiLineOptions += target.GetProperty("OUTPUT_NAME");
- libMultiLineOptions += " \n";
+ outputName = outName;
+ }
+ else
+ {
+ outputName = target.GetName();
}
+ outputName += ".exe";
}
if(target.GetType() == cmTarget::SHARED_LIBRARY)
{
@@ -1095,6 +1099,11 @@ void cmLocalVisualStudio6Generator
cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES",
libMultiLineOptimizedOptions.c_str());
+ // Replace the template file text OUTPUT_NAME with the real output
+ // name that will be used. Only the executable template should
+ // have this text.
+ cmSystemTools::ReplaceString(line, "OUTPUT_NAME", outputName.c_str());
+
cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
m_IncludeOptions.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName);