Hello the world,

I would like to submit the following changes to the cmake repository until 
someone finds a better solution.

This fix an issue with the Visual Studio 2010 generator:

When none of the options /Z7, /Zi and /ZI are specified in the cmake project 
settings, the project will open in the editor with "Program Database" as the 
default debug information format, ending up always generating PDBs regardless 
of project configuration.

This change will modify the output project file so that if the debug 
information format is not specified in the cmake project settings, it will 
default to no PDB generated, just like all the previous other Visual Studio 
versions. This problem comes from the fact that Microsoft changed the default 
setting of the debug information format to be "Program Database" instead of 
"Disabled", and not an error from cmake itself.

The changes are as follow:

cmVisualStudio10TargetGenerator.cxx : around line 1037, function 
cmVisualStudio10TargetGenerator::WriteClOptions

   ...
   clOptions.OutputAdditionalOptions(*this->BuildFileStream, "      ", "");
   this->OutputIncludes(includes);
   clOptions.OutputFlagMap(*this->BuildFileStream, "      ");
+
+  //If not in debug mode, write the DebugInformationFormat
+  //field without value so PDBs don't get generated uselessly.
+  if( !clOptions.IsDebug() )
+  {
+    this->WriteString("<DebugInformationFormat></DebugInformationFormat>\n", 
3);
+  }
+
   clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, "      ",
                                             "\n");
   this->WriteString("<AssemblerListingLocation>", 3);
   ...



Robert Goulet
Software Development Manager
Autodesk Media & Entertainment

Autodesk, Inc.
10 Duke
Montreal, QC H3C 2L7

Direct 514 954-3911

[cid:image001.gif@01CB3EE3.93E2BE40]

<<inline: image001.gif>>

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to