Merge topic 'vs7-OutputDirectory'

fa8b30eb VS: Fix .vcproj and .vfproj file OutputDirectory generation
aa2ba121 VS: Use $(ConfigurationName) as CMAKE_CFG_INTDIR in VS 7, 8, 9
This commit is contained in:
Brad King 2015-02-17 10:09:13 -05:00 committed by CMake Topic Stage
commit 5c635fa624
4 changed files with 30 additions and 9 deletions

View File

@ -0,0 +1,10 @@
vs7-OutputDirectory
-------------------
* The :variable:`CMAKE_CFG_INTDIR` variable value for Visual Studio
7, 8, and 9 is now ``$(ConfigurationName)`` instead of ``$(OutDir)``.
This should have no effect on the intended use cases of the variable.
* With Visual Studio 7, 8, and 9 generators the value of the ``$(OutDir)``
placeholder no longer evaluates to the configuration name. Projects
should use ``$(ConfigurationName)`` for that instead.

View File

@ -12,11 +12,11 @@ values:
:: ::
$(IntDir) = Visual Studio 6 $(IntDir) = Visual Studio 6
$(OutDir) = Visual Studio 7, 8, 9 $(ConfigurationName) = Visual Studio 7, 8, 9
$(Configuration) = Visual Studio 10 $(Configuration) = Visual Studio 10
$(CONFIGURATION) = Xcode $(CONFIGURATION) = Xcode
. = Make-based tools . = Make-based tools
Since these values are evaluated by the native build system, this Since these values are evaluated by the native build system, this
variable is suitable only for use in command lines that will be variable is suitable only for use in command lines that will be

View File

@ -94,7 +94,8 @@ public:
std::string& dir); std::string& dir);
///! What is the configurations directory variable called? ///! What is the configurations directory variable called?
virtual const char* GetCMakeCFGIntDir() const { return "$(OutDir)"; } virtual const char* GetCMakeCFGIntDir() const
{ return "$(ConfigurationName)"; }
/** Return true if the target project file should have the option /** Return true if the target project file should have the option
LinkLibraryDependencies and link to .sln dependencies. */ LinkLibraryDependencies and link to .sln dependencies. */

View File

@ -669,8 +669,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
fout << "\t\t<Configuration\n" fout << "\t\t<Configuration\n"
<< "\t\t\tName=\"" << configName << "\t\t\tName=\"" << configName
<< "|" << gg->GetPlatformName() << "\"\n" << "|" << gg->GetPlatformName() << "\"\n";
<< "\t\t\tOutputDirectory=\"" << configName << "\"\n";
// This is an internal type to Visual Studio, it seems that: // This is an internal type to Visual Studio, it seems that:
// 4 == static library // 4 == static library
// 2 == dll // 2 == dll
@ -798,6 +797,16 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
std::string intermediateDir = this->GetTargetDirectory(target); std::string intermediateDir = this->GetTargetDirectory(target);
intermediateDir += "/"; intermediateDir += "/";
intermediateDir += configName; intermediateDir += configName;
if (target.GetType() < cmTarget::UTILITY)
{
std::string const& outDir =
target.GetType() == cmTarget::OBJECT_LIBRARY?
intermediateDir : target.GetDirectory(configName);
fout << "\t\t\tOutputDirectory=\""
<< this->ConvertToXMLOutputPathSingle(outDir.c_str()) << "\"\n";
}
fout << "\t\t\tIntermediateDirectory=\"" fout << "\t\t\tIntermediateDirectory=\""
<< this->ConvertToXMLOutputPath(intermediateDir.c_str()) << this->ConvertToXMLOutputPath(intermediateDir.c_str())
<< "\"\n" << "\"\n"
@ -1441,7 +1450,8 @@ cmLocalVisualStudio7Generator
// First search a configuration-specific subdirectory and then the // First search a configuration-specific subdirectory and then the
// original directory. // original directory.
fout << comma << this->ConvertToXMLOutputPath((dir+"/$(OutDir)").c_str()) fout << comma
<< this->ConvertToXMLOutputPath((dir+"/$(ConfigurationName)").c_str())
<< "," << this->ConvertToXMLOutputPath(dir.c_str()); << "," << this->ConvertToXMLOutputPath(dir.c_str());
comma = ","; comma = ",";
} }