| View Issue Details [ Jump to Notes ] | [ Print ] |
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0015285 | CMake | CMake | public | 2014-12-04 14:41 | 2015-05-04 09:05 |
|
| Reporter | Braden McDaniel | |
| Assigned To | | |
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | duplicate | |
| Platform | | OS | | OS Version | |
| Product Version | CMake 3.0.2 | |
| Target Version | | Fixed in Version | | |
|
| Summary | 0015285: Cannot escape "#" in add_compile_options |
| Description | I've found no way to escape the "#" character when it needs to occur in an compiler option in the add_compile_options command. When adding such an option to, for instance, the CMAKE_CXX_FLAGS variable, it can be escaped with a backslash ("\"); but this does not appear to work when using add_compile_options. |
| Steps To Reproduce | For example:
add_compile_options(-Wno-\#pragma-messages)
In the generated output (using the Unix Makefile generator), this string is added to the command line:
"-Wno-
|
| Additional Information | This is workable; but does not use add_compile_options:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-\\#pragma-messages")
|
| Tags | No tags attached. |
|
| Attached Files | |
|