From 297c63fa65327491a2b50e521b661c5835a19fe4 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 13 Aug 2013 07:48:01 -0400 Subject: Imported Upstream version 2.8.11.2 --- Source/cmLocalVisualStudio6Generator.cxx | 35 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'Source/cmLocalVisualStudio6Generator.cxx') diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index f15322be6..dc94476c8 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -325,19 +325,22 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, if(!cmSystemTools::FileExists(source.c_str())) { cmSystemTools::ReplaceString(source, "$(IntDir)/", ""); + // Make sure the path exists for the file + std::string path = cmSystemTools::GetFilenamePath(source); + cmSystemTools::MakeDirectory(path.c_str()); #if defined(_WIN32) || defined(__CYGWIN__) - std::ofstream fout(source.c_str(), + std::ofstream sourceFout(source.c_str(), std::ios::binary | std::ios::out | std::ios::trunc); #else - std::ofstream fout(source.c_str(), + std::ofstream sourceFout(source.c_str(), std::ios::out | std::ios::trunc); #endif - if(fout) + if(sourceFout) { - fout.write("# generated from CMake",22); - fout.flush(); - fout.close(); + sourceFout.write("# generated from CMake",22); + sourceFout.flush(); + sourceFout.close(); } } } @@ -710,6 +713,8 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b, switch(b) { + case WIN32_EXECUTABLE: + break; case STATIC_LIBRARY: this->DSPHeaderTemplate = root; this->DSPHeaderTemplate += "/staticLibHeader.dsptemplate"; @@ -1695,25 +1700,21 @@ void cmLocalVisualStudio6Generator std::set minsizeDefinesSet; std::set debugrelDefinesSet; - - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(&target); - this->AppendDefines( definesSet, - gt->GetCompileDefinitions()); + target.GetCompileDefinitions(0)); this->AppendDefines( debugDefinesSet, - gt->GetCompileDefinitions("DEBUG")); + target.GetCompileDefinitions("DEBUG")); this->AppendDefines( releaseDefinesSet, - gt->GetCompileDefinitions("RELEASE")); + target.GetCompileDefinitions("RELEASE")); this->AppendDefines( minsizeDefinesSet, - gt->GetCompileDefinitions("MINSIZEREL")); + target.GetCompileDefinitions("MINSIZEREL")); this->AppendDefines( debugrelDefinesSet, - gt->GetCompileDefinitions("RELWITHDEBINFO")); + target.GetCompileDefinitions("RELWITHDEBINFO")); std::string defines = " "; std::string debugDefines = " "; @@ -1783,10 +1784,8 @@ void cmLocalVisualStudio6Generator const std::string extraOptions, std::string& options) { - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(&target); // Compute the link information for this configuration. - cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName); + cmComputeLinkInformation* pcli = target.GetLinkInformation(configName); if(!pcli) { return; -- cgit v1.2.3