diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2005-03-22 12:26:45 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2005-03-22 12:26:45 (GMT) |
commit | c2ad3e4afc271bea59c98562b4695232d399714f (patch) | |
tree | ae7fe7b01fd643abec8920fafd2051ef8d04f9fe /Source | |
parent | 56c0b620954725df2a885fd83317f901fc93bc27 (diff) | |
download | CMake-c2ad3e4afc271bea59c98562b4695232d399714f.zip CMake-c2ad3e4afc271bea59c98562b4695232d399714f.tar.gz CMake-c2ad3e4afc271bea59c98562b4695232d399714f.tar.bz2 |
ENH: fix adding of rc files
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 4fa4497..6e64b1b 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -37,6 +37,9 @@ void cmLocalVisualStudio7Generator::Generate() std::set<cmStdString> lang; lang.insert("C"); lang.insert("CXX"); + lang.insert("RC"); + lang.insert("IDL"); + lang.insert("DEF"); this->CreateCustomTargetsAndCommands(lang); this->OutputVCProjFile(); } @@ -343,24 +346,27 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, target.GetName()); return; } - std::string baseFlagVar = "CMAKE_"; - baseFlagVar += linkLanguage; - baseFlagVar += "_FLAGS"; - flags = m_Makefile->GetRequiredDefinition(baseFlagVar.c_str()); - - std::string flagVar = baseFlagVar + "_RELEASE"; - flagsRelease += m_Makefile->GetRequiredDefinition(flagVar.c_str()); - - flagVar = baseFlagVar + "_MINSIZEREL"; - flagsMinSize += m_Makefile->GetRequiredDefinition(flagVar.c_str()); - - flagVar = baseFlagVar + "_DEBUG"; - flagsDebug += m_Makefile->GetRequiredDefinition(flagVar.c_str()); - - flagVar = baseFlagVar + "_RELWITHDEBINFO"; - flagsDebugRel += m_Makefile->GetRequiredDefinition(flagVar.c_str()); + if(!(strcmp(linkLanguage, "RC") == 0 || strcmp(linkLanguage, "DEF") == 0)) + { + std::string baseFlagVar = "CMAKE_"; + baseFlagVar += linkLanguage; + baseFlagVar += "_FLAGS"; + flags = m_Makefile->GetRequiredDefinition(baseFlagVar.c_str()); + + std::string flagVar = baseFlagVar + "_RELEASE"; + flagsRelease += m_Makefile->GetRequiredDefinition(flagVar.c_str()); + + flagVar = baseFlagVar + "_MINSIZEREL"; + flagsMinSize += m_Makefile->GetRequiredDefinition(flagVar.c_str()); + + flagVar = baseFlagVar + "_DEBUG"; + flagsDebug += m_Makefile->GetRequiredDefinition(flagVar.c_str()); + + flagVar = baseFlagVar + "_RELWITHDEBINFO"; + flagsDebugRel += m_Makefile->GetRequiredDefinition(flagVar.c_str()); + } } - + std::string programDatabase; const char* pre = "WIN32,_DEBUG,_WINDOWS"; std::string debugPostfix = ""; @@ -1037,10 +1043,20 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, else if(compileFlags.size() || additionalDeps.length()) { const char* aCompilerTool = "VCCLCompilerTool"; - if((*sf)->GetSourceExtension() == "idl") + std::string ext = (*sf)->GetSourceExtension(); + ext = cmSystemTools::LowerCase(ext); + if(ext == "idl") { aCompilerTool = "VCMIDLTool"; } + if(ext == "rc") + { + aCompilerTool = "VCResourceCompilerTool"; + } + if(ext == "def") + { + aCompilerTool = "VCCustomBuildTool"; + } for(std::vector<std::string>::iterator i = configs->begin(); i != configs->end(); ++i) { |