[CMake] CMake 2.4.2 generates undebuggable .vcproj projects.

Rob Mathews Rob.Mathews at varolii.com
Thu May 24 11:56:18 EDT 2007


To reproduce, take CMake 2.4.1 from CVS and build it. 

Open the CMake.sln file, right click on CMake project, choose
properties. 

Look Properties->C/C++->General tag, the "Debug Information Format"
field. It says "Disabled". 

Ie, you can't set a breakpoint. Or, rather, you set the breakpoint and
as so as you run the program all the breakpoints change to '?' and they
don't work. 

This is because the vcproj file is incorrect, and lacks a
DebugInformationFormat tag on the VCCLCompilerTool. 

Ie, DebugInformationFormat="3", as in: 

			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories="b:\"
	
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
				MinimalRebuild="TRUE"
				BasicRuntimeChecks="3"
				RuntimeLibrary="5"
				UsePrecompiledHeader="3"
				WarningLevel="3"
				Detect64BitPortabilityProblems="TRUE"
				DebugInformationFormat="3"/>

Also, the linker tool, GenerateDebugInformation="TRUE", as in: 

			<Tool
				Name="VCLinkerTool"
	
OutputFile="$(OutDir)/boost_function.exe"
				LinkIncremental="2"
				GenerateDebugInformation="TRUE"
	
ProgramDatabaseFile="$(OutDir)/boost_function.pdb"
				SubSystem="1"
				TargetMachine="1"/>


Obviously, this is a trivial fix to
Source\cmLocalVisualStudio7Generator.cxx, in and around lines 498. 





More information about the CMake mailing list