MantisBT - CMake
View Issue Details
0010638CMakeCMakepublic2010-04-29 02:002011-06-17 18:10
Alexander 
David Cole 
normalfeaturealways
closedfixed 
CMake-2-8 
CMake 2.8.5CMake 2.8.5 
0010638: Enable code analysis in Visual Studio 9 (2008)
There is no way to enable code analysis for C/C++ on Visual Studio 2008 build. Microsoft document "/analize" flag on cl.exe, but it dosn't work.
Microsoft use "EnablePREfast" boolean attribute on VisualStudioProject/Configurations/Configuration/Tool[@Name='VCCLCompilerTool'] in .vcproj
When I add two flags to cmVS8ExtraFlagTable (), the problem was solved and cmake command:
set( CMAKE_C_FLAGS "-analize" )
turned code analysis ON, and command
set( CMAKE_C_FLAGS "-analize-" )
turned code analysis OFF.

When cmake project dosn't contain nether "-analize" nor "-analize-" flags vcproj dosn't contain EnablePREfast attribute.
static cmVS7FlagTable cmVS8ExtraFlagTable[] =
...
  {"EnablePREfast", "analize", "enable code analysis for c/c++ on build",
     "TRUE", 0},
  {"EnablePREfast", "analize-", "disable code analysis for c/c++ on build",
     "FALSE", 0},
...
No tags attached.
Issue History
2010-04-29 02:00AlexanderNew Issue
2011-01-17 15:39David ColeAssigned To => David Cole
2011-01-17 15:39David ColeStatusnew => assigned
2011-02-01 13:57David ColeNote Added: 0025200
2011-02-01 13:57David ColeStatusassigned => resolved
2011-02-01 13:57David ColeResolutionopen => fixed
2011-02-16 11:42David ColeTarget Version => CMake 2.8.5
2011-06-06 18:25David ColeStatusresolved => closed
2011-06-06 18:25David ColeNote Added: 0026715
2011-06-17 18:10David ColeFixed in Version => CMake 2.8.5

Notes
(0025200)
David Cole   
2011-02-01 13:57   
Fix pushed to 'next'
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15e422249eab4d920ffeb3de08057d35f3bc6387 [^]
(0026715)
David Cole   
2011-06-06 18:25   
Closing resolved issues that have not been updated in more than 3 months.