summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-02-07 19:04:16 (GMT)
committerBrad King <brad.king@kitware.com>2003-02-07 19:04:16 (GMT)
commitcde384411d1907d93369c144ec7b2f28da2628d5 (patch)
tree2b5aeb18901a5c20d408b3eff32e27e82c252be8 /Source/cmLocalVisualStudio7Generator.cxx
parentf2b47501694f6951c97335676b2c577cbb4fd76f (diff)
downloadCMake-cde384411d1907d93369c144ec7b2f28da2628d5.zip
CMake-cde384411d1907d93369c144ec7b2f28da2628d5.tar.gz
CMake-cde384411d1907d93369c144ec7b2f28da2628d5.tar.bz2
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.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx41
1 files changed, 36 insertions, 5 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 69064ff..ef287b9 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -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,13 +1005,19 @@ void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout)
}
-std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPath(const char* path)
+std::string cmLocalVisualStudio7Generator::EscapeForXML(const char* s)
{
- std::string ret = cmSystemTools::ConvertToOutputPath(path);
+ std::string ret = s;
cmSystemTools::ReplaceString(ret, "\"", "&quot;");
return ret;
}
+std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPath(const char* path)
+{
+ std::string ret = cmSystemTools::ConvertToOutputPath(path);
+ return cmLocalVisualStudio7Generator::EscapeForXML(ret.c_str());
+}
+
std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPathSingle(const char* path)
{
std::string ret = cmSystemTools::ConvertToOutputPath(path);