MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014429 | CMake | CMake | public | 2013-09-20 16:17 | 2014-03-05 09:58 |
Reporter | Rob Stewart | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | OS | OS Version | |||
Product Version | CMake 2.8.11 | ||||
Target Version | Fixed in Version | ||||
Summary | 0014429: SET_TARGET_PROPERTIES() Broken for COMPILE_DEFINITIONS? | ||||
Description | According to my efforts, SET_TARGET_PROPERTIES() fails for COMPILE_DEFINITIONS. On the one hand, one might suppose that none of the values should be prefixed by "-D", thinking that the contents of that property will be enumerated and that "-D" or "/D" will be inserted ahead of each value on the command line. That doesn't work. The values appear as set by SET_TARGET_PROPERTIES(). So, one decides to ensure that all values are prefixed by "-D". That doesn't work either, according to what I'm seeing. The problem is that the first one is prefixed by "-D" and none of the rest are. IOW, it seems like SET_TARGET_PROPERTIES(), for COMPILE_DEFINITIONS, expects only one definition, but since one must, in general, use GET_TARGET_PROPERTY() first, to get the current values, then add new definitions, one is very likely to set multiple definitions. Either SET_TARGET_PROPERTIES() should require "-D" prefixed to each definition, when setting COMPILE_DEFINITIONS, or it should expect that no value is prefixed. I think that SET_TARGET_PROPERTIES() should accept a quoted list (with semicolons), not just a space separated list of values, so I suggest that SET_TARGET_PROPERTIES(target PROPERTIES COMPILE_DEFINITIONS "value") iterate value and prepend "-D", as needed. Since that property is actually used after it is set, I'm really suggesting that the using code do the iteration (SET_TARGET_PROPERTIES() should really just save the values it's given). | ||||
Steps To Reproduce | SET_TARGET_PROPERTIES(target PROPERTIES COMPILE_DEFINITIONS "a b c") Observe "-Da b c" in the compilation command. SET_TARGET_PROPERTIES(target PROPERTIES COMPILE_DEFINITIONS "-Da -Db -Dc") Observe "-D-Da -Db -Dc" in the compilation command. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-09-20 16:17 | Rob Stewart | New Issue | |||
2013-09-20 16:42 | Brad King | Note Added: 0033856 | |||
2013-09-20 16:45 | Brad King | Note Added: 0033857 | |||
2013-09-20 16:45 | Brad King | Status | new => resolved | ||
2013-09-20 16:45 | Brad King | Resolution | open => no change required | ||
2013-09-20 16:51 | Rob Stewart | Note Added: 0033858 | |||
2013-09-20 16:51 | Rob Stewart | Status | resolved => feedback | ||
2013-09-20 16:51 | Rob Stewart | Resolution | no change required => reopened | ||
2013-09-22 20:15 | Brad King | Status | feedback => resolved | ||
2013-09-22 20:15 | Brad King | Resolution | reopened => no change required | ||
2013-09-22 20:15 | Brad King | Assigned To | => Brad King | ||
2013-09-22 20:24 | Brad King | Note Added: 0033861 | |||
2014-03-05 09:58 | Robert Maynard | Note Added: 0035263 | |||
2014-03-05 09:58 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|