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.

This commit is contained in:
Brad King 2005-08-19 17:57:36 -04:00
parent 98e5119664
commit 05e6c3f3ba
2 changed files with 19 additions and 6 deletions

View File

@ -964,20 +964,24 @@ void cmLocalVisualStudio6Generator
} }
} }
} }
std::string outputName = "(OUTPUT_NAME is for executables only)";
std::string extraLinkOptions; std::string extraLinkOptions;
if(target.GetType() == cmTarget::EXECUTABLE) if(target.GetType() == cmTarget::EXECUTABLE)
{ {
extraLinkOptions = extraLinkOptions =
m_Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS"); m_Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS");
// Use the OUTPUT_NAME property if it was set. This is supported
// if the executable has an output name then add the appropriate flag // only for executables.
if (target.GetProperty("OUTPUT_NAME")) if(const char* outName = target.GetProperty("OUTPUT_NAME"))
{ {
libMultiLineOptions += "# ADD LINK32 /out:"; outputName = outName;
libMultiLineOptions += target.GetProperty("OUTPUT_NAME");
libMultiLineOptions += " \n";
} }
else
{
outputName = target.GetName();
}
outputName += ".exe";
} }
if(target.GetType() == cmTarget::SHARED_LIBRARY) if(target.GetType() == cmTarget::SHARED_LIBRARY)
{ {
@ -1095,6 +1099,11 @@ void cmLocalVisualStudio6Generator
cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES", cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES",
libMultiLineOptimizedOptions.c_str()); 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", cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
m_IncludeOptions.c_str()); m_IncludeOptions.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName);

View File

@ -69,6 +69,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089 # ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089 # ADD LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHRelease\OUTPUT_NAME"
CM_MULTILINE_OPTIMIZED_LIBRARIES CM_MULTILINE_OPTIMIZED_LIBRARIES
CM_MULTILINE_LIBRARIES CM_MULTILINE_LIBRARIES
@ -101,6 +102,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089 # ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089 # ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHDebug\OUTPUT_NAME"
CM_MULTILINE_DEBUG_LIBRARIES CM_MULTILINE_DEBUG_LIBRARIES
CM_MULTILINE_LIBRARIES_FOR_DEBUG CM_MULTILINE_LIBRARIES_FOR_DEBUG
@ -130,6 +132,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089 # ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089 # ADD LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHMinSizeRel\OUTPUT_NAME"
CM_MULTILINE_OPTIMIZED_LIBRARIES CM_MULTILINE_OPTIMIZED_LIBRARIES
CM_MULTILINE_LIBRARIES CM_MULTILINE_LIBRARIES
@ -160,6 +163,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /IGNORE:4089 # ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /IGNORE:4089
# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /IGNORE:4089 # ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHRelWithDebInfo\OUTPUT_NAME"
CM_MULTILINE_OPTIMIZED_LIBRARIES CM_MULTILINE_OPTIMIZED_LIBRARIES
CM_MULTILINE_LIBRARIES CM_MULTILINE_LIBRARIES