MantisBT - CMake
View Issue Details
0014182CMake(No Category)public2013-05-31 06:442016-06-10 14:31
YYrhs 
Kitware Robot 
lowfeaturehave not tried
closedmoved 
CMake 2.8.11 
 
0014182: set_property file.c PROPERTY COMPILE_FLAGS should allow a list of flags
set_property(SOURCE file.c PROPERTY COMPILE_FLAGS "-DX=FOO -DBAR=ZOO")

is nice, unless you want to pass strings with spaces etc. I can't imagine setting compile flags this way is very portable.

The alternative is to create "static libraries", set additional cflags for those, then link agains the static libraries - but that's overkill.

Setting priority to low because I don't require the feature (evaluating alternative configuration tools trying to find one which can run cofiguration tests in parallel)
No tags attached.
related to 0006493closed Stephen Kelly configuration dependent COMPILE_FLAGS for SET_TARGET_PROPERTIES 
Issue History
2013-05-31 06:44YYrhsNew Issue
2013-05-31 08:06Brad KingRelationship addedrelated to 0006493
2013-05-31 08:08Brad KingNote Added: 0033160
2013-05-31 08:08Brad KingAssigned To => Stephen Kelly
2013-05-31 08:08Brad KingSeverityminor => feature
2013-05-31 08:08Brad KingStatusnew => assigned
2013-05-31 08:09Brad KingNote Added: 0033161
2013-06-03 12:56Stephen KellyNote Added: 0033215
2013-06-03 12:56Stephen KellyAssigned ToStephen Kelly =>
2013-06-03 12:56Stephen KellyStatusassigned => backlog
2016-06-10 14:28Kitware RobotNote Added: 0042292
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0033160)
Brad King   
2013-05-31 08:08   
The COMPILE_FLAGS property was originally created as a hook for low-level access to the generated compilation command lines. A higher-level COMPILE_OPTIONS property that works with lists and handles escaping automatically has been considered for a long time.

I think Stephen's current work on a COMPILE_OPTIONS property will resolve this.
(0033161)
Brad King   
2013-05-31 08:09   
FYI, you can already use the COMPILE_DEFINITIONS property to add preprocessor definitions:

 set_property(SOURCE file.c PROPERTY COMPILE_DEFINITIONS X=FOO BAR=ZOO)
(0033215)
Stephen Kelly   
2013-06-03 12:56   
This would require adding a COMPILE_OPTIONS property at the source file level.

Putting in the backlog until someone is interested in that.
(0042292)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.