summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-04-18 15:45:31 (GMT)
committerBrad King <brad.king@kitware.com>2006-04-18 15:45:31 (GMT)
commit428b4c92440091d798b0d6bcbae6544a168ca867 (patch)
tree04e1d5f2dcd82fb911208f71ab69ce21d4d53dd5 /Source
parent392137b6d7e53ee6e7187b530522f772137bcd6c (diff)
downloadCMake-428b4c92440091d798b0d6bcbae6544a168ca867.zip
CMake-428b4c92440091d798b0d6bcbae6544a168ca867.tar.gz
CMake-428b4c92440091d798b0d6bcbae6544a168ca867.tar.bz2
ENH: Updated VS6 generator to use target.GetFullName() to compute target file names.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx47
1 files changed, 25 insertions, 22 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 6fa2a9a..b1406d3 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1013,30 +1013,13 @@ void cmLocalVisualStudio6Generator
}
}
}
- std::string outputName = "(OUTPUT_NAME is for executables only)";
+
+ // Get extra linker options for this target type.
std::string extraLinkOptions;
- // TODO: Fix construction of library/executable name through
- // cmTarget. OUTPUT_LIBNAMEDEBUG_POSTFIX should be replaced by the
- // library's debug configuration name. OUTPUT_LIBNAME should be
- // replaced by the non-debug configuration name. This generator
- // should just be re-written to not use template files and just
- // generate the code. Setting up these substitutions is a pain.
if(target.GetType() == cmTarget::EXECUTABLE)
{
extraLinkOptions =
this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS");
-
- // Use the OUTPUT_NAME property if it was set. This is supported
- // only for executables.
- if(const char* outName = target.GetProperty("OUTPUT_NAME"))
- {
- outputName = outName;
- }
- else
- {
- outputName = target.GetName();
- }
- outputName += ".exe";
}
if(target.GetType() == cmTarget::SHARED_LIBRARY)
{
@@ -1047,6 +1030,24 @@ void cmLocalVisualStudio6Generator
extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS");
}
+ // Compute the real name of the target.
+ std::string outputName = "(OUTPUT_NAME is for libraries and executables only)";
+ std::string outputNameDebug = outputName;
+ std::string outputNameRelease = outputName;
+ std::string outputNameMinSizeRel = outputName;
+ std::string outputNameRelWithDebInfo = outputName;
+ if(target.GetType() == cmTarget::EXECUTABLE ||
+ target.GetType() == cmTarget::STATIC_LIBRARY ||
+ target.GetType() == cmTarget::SHARED_LIBRARY ||
+ target.GetType() == cmTarget::MODULE_LIBRARY)
+ {
+ outputName = target.GetFullName();
+ outputNameDebug = target.GetFullName("Debug");
+ outputNameRelease = target.GetFullName("Release");
+ outputNameMinSizeRel = target.GetFullName("MinSizeRel");
+ outputNameRelWithDebInfo = target.GetFullName("RelWithDebInfo");
+ }
+
if(extraLinkOptions.size())
{
libOptions += " ";
@@ -1174,9 +1175,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.
+ // Substitute the real output name into the template.
+ cmSystemTools::ReplaceString(line, "OUTPUT_NAME_DEBUG", outputNameDebug.c_str());
+ cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELEASE", outputNameRelease.c_str());
+ cmSystemTools::ReplaceString(line, "OUTPUT_NAME_MINSIZEREL", outputNameMinSizeRel.c_str());
+ cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELWITHDEBINFO", outputNameRelWithDebInfo.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_NAME", outputName.c_str());
cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",