[cmake-developers] [CMake 0014858]: Flags specified for the compiler do not stay together during processing.

Mantis Bug Tracker mantis at public.kitware.com
Tue Apr 1 11:51:27 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14858 
====================================================================== 
Reported By:                Michael Priestman
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14858
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-04-01 11:51 EDT
Last Modified:              2014-04-01 11:51 EDT
====================================================================== 
Summary:                    Flags specified for the compiler do not stay
together during processing.
Description: 
I want to enable code analysis in Visual Studio. To do this, you add the
following flags to the compiler:

/analyze /analyze:log output.xml

When I try to do this with the following snippet of CMake:

set(CMAKE_C_FLAGS "/analyze /analyze:log output.xml")

It mangles the arguments. Firstly, it puts quotes around the "log" part, and
secondly, the "output.xml" does not follow immediately after the "/analyze:log"
argument, which is a compile error.

I have had this working in a previous version of CMake; I think it worked in
version 2.8.9, but stopped working in (I think) 2.8.12.

Steps to Reproduce: 
Attached files reproduce the problem with Visual Studio 11 generator.

Generate Visual Studio 11 solution and try to build. You'll get a compile error
saying /analyze:log requires an argument.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-04-01 11:51 Michael PriestmanNew Issue                                    
2014-04-01 11:51 Michael PriestmanFile Added: CMakeAnalyzeError.zip             
      
======================================================================



More information about the cmake-developers mailing list