diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 0f74c20ac..95e46b840 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -536,18 +536,6 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b, std::string root= m_Makefile->GetRequiredDefinition("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; @@ -611,8 +599,6 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b, std::string line; while(cmSystemTools::GetLineFromStream(fin, line)) { - cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME_EXPORTS", - exportSymbol.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName); if (reg.find(line)) { @@ -996,7 +982,19 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha staticLibOptions = libflags; } } - + 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()); + } + + std::string line; while(cmSystemTools::GetLineFromStream(fin, line)) { @@ -1005,6 +1003,8 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha { mfcFlag = "0"; } + cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME_EXPORTS", + exportSymbol.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE", customRuleCode.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG", diff --git a/Templates/staticLibHeader.dsptemplate b/Templates/staticLibHeader.dsptemplate index c710106e0..a84900b15 100644 --- a/Templates/staticLibHeader.dsptemplate +++ b/Templates/staticLibHeader.dsptemplate @@ -55,7 +55,7 @@ RSC=rc.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c # ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_LIB" /FD /c -# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS" +# ADD CPP BUILD_INCLUDES EXTRA_DEFINES # ADD CPP CMAKE_CXX_FLAGS # ADD CPP CMAKE_CXX_FLAGS_RELEASE # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -83,7 +83,7 @@ CMAKE_CUSTOM_RULE_CODE # PROP Target_Dir "" # ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_LIB" /FD /c # ADD CPP /nologo /D "_DEBUG" /D "WIN32" /D "_LIB" /FD /GZ /c -# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS" +# ADD CPP BUILD_INCLUDES EXTRA_DEFINES # ADD CPP CMAKE_CXX_FLAGS # ADD CPP CMAKE_CXX_FLAGS_DEBUG # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -112,7 +112,7 @@ CMAKE_CUSTOM_RULE_CODE # PROP Target_Dir "" # ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_ATL_DLL" /FD /c # ADD CPP /nologo /D "NDEBUG" /D "_ATL_DLL" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c -# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS" +# ADD CPP BUILD_INCLUDES EXTRA_DEFINES # ADD CPP CMAKE_CXX_FLAGS # ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -140,7 +140,7 @@ CMAKE_CUSTOM_RULE_CODE # PROP Target_Dir "" # ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c # ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_LIB" /FD /c -# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS" +# ADD CPP BUILD_INCLUDES EXTRA_DEFINES # ADD CPP CMAKE_CXX_FLAGS # ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO # ADD BASE RSC /l 0x409 /d "NDEBUG"