mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 22:59:56 -05:00
Several fixes/improvements:
- Fixed CollapseFullPath to work on relative paths with base paths
not in the current working directory.
- INCLUDE command now supports relative paths (using above fix).
- Added ABSOLUTE option to GET_FILENAME_COMPONENT command to
unwind symlinks and relative paths.
- Fixed libName_EXPORTS macro definition to be valid C identifier.
- Added DEFINE_SYMBOL target propterty for customizing the export symbol.
- Implemented LINK_FLAGS target propterty for libraries in VC6 and VC7.
Several of these fixes were contributed by Gareth Jones.
This commit is contained in:
@@ -320,7 +320,18 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||
if(target.GetType() == cmTarget::SHARED_LIBRARY
|
||||
|| target.GetType() == cmTarget::MODULE_LIBRARY)
|
||||
{
|
||||
fout << "," << libName << "_EXPORTS";
|
||||
std::string exportSymbol;
|
||||
if (const char* custom_export_name = target.GetProperty("DEFINE_SYMBOL"))
|
||||
{
|
||||
exportSymbol = custom_export_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string id = libName;
|
||||
id += "_EXPORTS";
|
||||
exportSymbol = cmSystemTools::MakeCindentifier(id.c_str());
|
||||
}
|
||||
fout << "," << exportSymbol;
|
||||
}
|
||||
this->OutputDefineFlags(fout);
|
||||
fout << "\"\n";
|
||||
@@ -368,6 +379,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
||||
{
|
||||
debugPostfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
|
||||
}
|
||||
const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
|
||||
|
||||
switch(target.GetType())
|
||||
{
|
||||
case cmTarget::STATIC_LIBRARY:
|
||||
@@ -384,7 +397,13 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
||||
case cmTarget::MODULE_LIBRARY:
|
||||
fout << "\t\t\t<Tool\n"
|
||||
<< "\t\t\t\tName=\"VCLinkerTool\"\n"
|
||||
<< "\t\t\t\tAdditionalOptions=\"/MACHINE:I386\"\n"
|
||||
<< "\t\t\t\tAdditionalOptions=\"/MACHINE:I386";
|
||||
if(targetLinkFlags)
|
||||
{
|
||||
fout << " " << cmLocalVisualStudio7Generator::EscapeForXML(
|
||||
targetLinkFlags).c_str();
|
||||
}
|
||||
fout << "\"\n"
|
||||
<< "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
|
||||
this->OutputLibraries(fout, configName, libName, target);
|
||||
fout << "\"\n";
|
||||
@@ -429,7 +448,13 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
||||
|
||||
fout << "\t\t\t<Tool\n"
|
||||
<< "\t\t\t\tName=\"VCLinkerTool\"\n"
|
||||
<< "\t\t\t\tAdditionalOptions=\"/MACHINE:I386\"\n"
|
||||
<< "\t\t\t\tAdditionalOptions=\"/MACHINE:I386";
|
||||
if(targetLinkFlags)
|
||||
{
|
||||
fout << " " << cmLocalVisualStudio7Generator::EscapeForXML(
|
||||
targetLinkFlags).c_str();
|
||||
}
|
||||
fout << "\"\n"
|
||||
<< "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
|
||||
this->OutputLibraries(fout, configName, libName, target);
|
||||
fout << "\"\n";
|
||||
@@ -980,11 +1005,17 @@ void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout)
|
||||
}
|
||||
|
||||
|
||||
std::string cmLocalVisualStudio7Generator::EscapeForXML(const char* s)
|
||||
{
|
||||
std::string ret = s;
|
||||
cmSystemTools::ReplaceString(ret, "\"", """);
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPath(const char* path)
|
||||
{
|
||||
std::string ret = cmSystemTools::ConvertToOutputPath(path);
|
||||
cmSystemTools::ReplaceString(ret, "\"", """);
|
||||
return ret;
|
||||
return cmLocalVisualStudio7Generator::EscapeForXML(ret.c_str());
|
||||
}
|
||||
|
||||
std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPathSingle(const char* path)
|
||||
|
||||
Reference in New Issue
Block a user