View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0011712 | CMake | CMake | public | 2011-01-17 06:25 | 2011-01-31 15:58 | ||||
Reporter | Andreas Pakulat | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | not fixable | ||||||
Platform | OS | OS Version | |||||||
Product Version | CMake-2-8 | ||||||||
Target Version | CMake 2.8.4 | Fixed in Version | CMake 2.8.4 | ||||||
Summary | 0011712: add_definitions/COMPILE_DEFINITIONS do not support defines with semicolon | ||||||||
Description | Trying to add a define which has a semicolon in its text results in completely broken compiler commandlines with wrong escaping of arguments. The attached project shows this, there doesn't seem to be a way to escape the semicolon so that cmake ignores it. CMake always interprets that as a separator for the list of defines apparently, which then breaks the compile-commandline due to broken quoting. I tried this with both gnu makefiles and gcc as well as nmake makefiles and cl, with the same results. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | ![]() | ||||||||
Relationships | ||||||
|
Relationships |
Notes | |
(0024737) Brad King (manager) 2011-01-17 07:39 |
There is a disclaimer about this in the documentation: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:COMPILE_DEFINITIONS [^] "Dislaimer: Most native build tools have poor support for escaping certain values. CMake has work-arounds for many cases but some values may just not be possible to pass correctly." |
(0024738) Brad King (manager) 2011-01-17 07:41 |
There are also a bunch of comments about it for our reference here: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Preprocess/CMakeLists.txt;hb=v2.8.3 [^] Back when I implemented COMPILE_DEFINITIONS I tried to get every key on the US keyboard to pass through definitions correctly on all supported build systems. Semicolon is basically impossible to do everywhere. I suggest using configure_file to put the definition directly in a header. |
(0024739) Brad King (manager) 2011-01-17 08:25 |
> there doesn't seem to be a way to escape the semicolon so that cmake ignores it. Either of these works: set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS "PATH_SEP=\"\;\"") OR add_definitions( "-DPATH_SEP=\"\;\"") |
(0024740) Brad King (manager) 2011-01-17 08:30 |
Documentation updated to mention known limitations: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c64d1385 [^] |
(0024748) Andreas Pakulat (reporter) 2011-01-17 09:56 |
Indeed that version does work, should've thought about that earlier :| |
(0024750) Brad King (manager) 2011-01-17 10:02 |
Closing as "not fixable" because the semicolon really can't be made to work everywhere. The documentation update is a good "fix" though. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2011-01-17 06:25 | Andreas Pakulat | New Issue | |
2011-01-17 06:25 | Andreas Pakulat | File Added: tst_sep.tar.gz | |
2011-01-17 07:38 | Brad King | Assigned To | => Brad King |
2011-01-17 07:38 | Brad King | Status | new => assigned |
2011-01-17 07:39 | Brad King | Note Added: 0024737 | |
2011-01-17 07:41 | Brad King | Note Added: 0024738 | |
2011-01-17 07:45 | Brad King | Relationship added | related to 0011660 |
2011-01-17 08:25 | Brad King | Note Added: 0024739 | |
2011-01-17 08:30 | Brad King | Note Added: 0024740 | |
2011-01-17 09:56 | Andreas Pakulat | Note Added: 0024748 | |
2011-01-17 10:02 | Brad King | Note Added: 0024750 | |
2011-01-17 10:02 | Brad King | Status | assigned => closed |
2011-01-17 10:02 | Brad King | Resolution | open => not fixable |
2011-01-31 15:58 | David Cole | Fixed in Version | => CMake 2.8.4 |
2011-01-31 15:58 | David Cole | Target Version | => CMake 2.8.4 |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |