summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-12-17 15:04:39 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-12-17 15:04:39 (GMT)
commit6a0a8331ef21e4c51d06b4b4c4d46e57eba3a6a8 (patch)
tree6f30c00733c674efe03b4050f2bf08739d1d9e99 /Source
parent72cde70ee88d107239e6b0d7b8392c2e046090b4 (diff)
downloadCMake-6a0a8331ef21e4c51d06b4b4c4d46e57eba3a6a8.zip
CMake-6a0a8331ef21e4c51d06b4b4c4d46e57eba3a6a8.tar.gz
CMake-6a0a8331ef21e4c51d06b4b4c4d46e57eba3a6a8.tar.bz2
some clean up in link directories
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx43
1 files changed, 35 insertions, 8 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index b5c7613..87e8e63 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -20,6 +20,7 @@
#include "cmSystemTools.h"
#include "cmSourceFile.h"
#include "cmCacheManager.h"
+#include "cmake.h"
cmLocalVisualStudio7Generator::cmLocalVisualStudio7Generator()
{
@@ -361,12 +362,18 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
const cmTarget &target)
{
std::string temp;
+ std::string debugPostfix = "";
+ bool debug = !strcmp(configName,"Debug");
+ if (debug && m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"))
+ {
+ debugPostfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
+ }
switch(target.GetType())
{
case cmTarget::STATIC_LIBRARY:
{
std::string libpath = m_LibraryOutputPath +
- "$(OutDir)/" + libName + ".lib";
+ "$(OutDir)/" + libName + debugPostfix + ".lib";
fout << "\t\t\t<Tool\n"
<< "\t\t\t\tName=\"VCLibrarianTool\"\n"
<< "\t\t\t\t\tOutputFile=\""
@@ -385,6 +392,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
temp += configName;
temp += "/";
temp += libName;
+ temp += debugPostfix;
temp += ".dll";
fout << "\t\t\t\tOutputFile=\""
<< this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
@@ -395,9 +403,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
fout << "\"\n";
this->OutputModuleDefinitionFile(fout, target);
temp = m_LibraryOutputPath;
- temp += "$(OutDir)";
- temp += "/";
+ temp += "$(OutDir)/";
temp += libName;
+ temp += debugPostfix;
temp += ".pdb";
fout << "\t\t\t\tProgramDatabaseFile=\"" <<
this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
@@ -412,6 +420,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
temp += configName;
temp += "/";
temp += libName;
+ temp += debugPostfix;
temp += ".lib";
fout << "\t\t\t\tImportLibrary=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n";
break;
@@ -491,8 +500,13 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(std::ostream& fout,
fout << this->ConvertToXMLOutputPath(temp.c_str()) << "," <<
this->ConvertToXMLOutputPath(m_LibraryOutputPath.c_str());
}
- if(m_ExecutableOutputPath.size())
+ if(m_ExecutableOutputPath.size() &&
+ (m_LibraryOutputPath != m_ExecutableOutputPath))
{
+ if (hasone)
+ {
+ fout << ",";
+ }
hasone = true;
std::string temp = m_ExecutableOutputPath;
temp += "$(INTDIR)";
@@ -517,7 +531,8 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(std::ostream& fout,
fout << ",";
}
std::string lpathi = lpath + "$(INTDIR)";
- fout << this->ConvertToXMLOutputPath(lpathi.c_str()) << "," << lpath;
+ fout << this->ConvertToXMLOutputPath(lpathi.c_str()) << "," <<
+ this->ConvertToXMLOutputPath(lpath.c_str());
hasone = true;
}
}
@@ -535,14 +550,26 @@ void cmLocalVisualStudio7Generator::OutputLibraries(std::ostream& fout,
if(j->first != libName)
{
std::string lib = j->first;
+ std::string debugPostfix = "";
+ // if this is a library we are building then watch for a debugPostfix
+ if (!strcmp(configName,"Debug"))
+ {
+ std::string libPath = j->first + "_CMAKE_PATH";
+ const char* cacheValue
+ = m_GlobalGenerator->GetCMakeInstance()->GetCacheDefinition(libPath.c_str());
+ if(cacheValue && m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"))
+ {
+ debugPostfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
+ }
+ }
if(j->first.find(".lib") == std::string::npos)
{
- lib += ".lib";
+ lib += debugPostfix + ".lib";
}
lib = this->ConvertToXMLOutputPath(lib.c_str());
if (j->second == cmTarget::GENERAL
- || (j->second == cmTarget::DEBUG && strcmp(configName, "DEBUG") == 0)
- || (j->second == cmTarget::OPTIMIZED && strcmp(configName, "DEBUG") != 0))
+ || (j->second == cmTarget::DEBUG && strcmp(configName, "Debug") == 0)
+ || (j->second == cmTarget::OPTIMIZED && strcmp(configName, "Debug") != 0))
{
fout << lib << " ";
}