summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio6Generator.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/cmLocalVisualStudio6Generator.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/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx39
1 files changed, 33 insertions, 6 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 5f0586d..bb251d3 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -82,20 +82,20 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
switch(l->second.GetType())
{
case cmTarget::STATIC_LIBRARY:
- this->SetBuildType(STATIC_LIBRARY, l->first.c_str());
+ this->SetBuildType(STATIC_LIBRARY, l->first.c_str(), l->second);
break;
case cmTarget::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY:
- this->SetBuildType(DLL, l->first.c_str());
+ this->SetBuildType(DLL, l->first.c_str(), l->second);
break;
case cmTarget::EXECUTABLE:
- this->SetBuildType(EXECUTABLE,l->first.c_str());
+ this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second);
break;
case cmTarget::WIN32_EXECUTABLE:
- this->SetBuildType(WIN32_EXECUTABLE,l->first.c_str());
+ this->SetBuildType(WIN32_EXECUTABLE,l->first.c_str(), l->second);
break;
case cmTarget::UTILITY:
- this->SetBuildType(UTILITY, l->first.c_str());
+ this->SetBuildType(UTILITY, l->first.c_str(), l->second);
break;
case cmTarget::INSTALL_FILES:
break;
@@ -444,11 +444,25 @@ void cmLocalVisualStudio6Generator::WriteDSPEndGroup(std::ostream& fout)
-void cmLocalVisualStudio6Generator::SetBuildType(BuildType b, const char *libName)
+void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
+ const char* libName,
+ const cmTarget& target)
{
std::string root= m_Makefile->GetDefinition("CMAKE_ROOT");
const char *def= m_Makefile->GetDefinition( "MSPROJECT_TEMPLATE_DIRECTORY");
+ std::string exportSymbol;
+ if (const char* custom_export_name = target.GetProperty("DEFINE_SYMBOL"))
+ {
+ exportSymbol = custom_export_name;
+ }
+ else
+ {
+ std::string in = libName;
+ in += "_EXPORTS";
+ exportSymbol = cmSystemTools::MakeCindentifier(in.c_str());
+ }
+
if( def)
{
root = def;
@@ -510,6 +524,8 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b, const char *libNam
{
fin.getline(buffer, 2048);
std::string line = buffer;
+ cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME_EXPORTS",
+ exportSymbol.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName);
if (reg.find(line))
{
@@ -793,6 +809,17 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
libMultiLineOptions += extraLinkOptions;
libMultiLineOptions += " \n";
}
+
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS"))
+ {
+ libOptions += " ";
+ libOptions += targetLinkFlags;
+ libOptions += " ";
+ libMultiLineOptions += "# ADD LINK32 ";
+ libMultiLineOptions += targetLinkFlags;
+ libMultiLineOptions += " \n";
+ }
+
// are there any custom rules on the target itself
// only if the target is a lib or exe