MantisBT - CMake | ||||||||||
| View Issue Details | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||
| 0015969 | CMake | CMake | public | 2016-02-11 02:58 | 2016-06-10 14:21 | |||||
| Reporter | A. Klitzing | |||||||||
| Assigned To | ||||||||||
| Priority | normal | Severity | major | Reproducibility | always | |||||
| Status | closed | Resolution | no change required | |||||||
| Platform | iOS | OS | OSX | OS Version | 10.10 | |||||
| Product Version | ||||||||||
| Target Version | Fixed in Version | |||||||||
| Summary | 0015969: String property broken in cmake 3.5.0-rc2 with XCode | |||||||||
| Description | We build our application for iOS with cmake and iOS toolchain file [1]. We pass some strings with "-D" property to the compiler. In cmake 3.5.0rc2 (rc1 not tested) the build will fail as the quotes of the strings are broken. Same code works with cmake 3.4.1. [1] https://github.com/cristeab/ios-cmake [^] | |||||||||
| Steps To Reproduce | 1. cmake ../source -DCMAKE_BUILD_TYPE=release -DCMAKE_PREFIX_PATH=/[...]/dist -DCMAKE_TOOLCHAIN_FILE=../source/cmake/iOS.toolchain.cmake -GXcode 2. xcodebuild -target install -configuration Release 3. Compiler failed | |||||||||
| Additional Information | Snippets of compiler cmdline: See at -DVERSION= 3.5.0-rc2: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch armv7 [.....] -std=c++11 -ObjC++ -fPIC -DVERSION=\\1.6.3+5-default-53920e4f2686\\ -MMD -MT dependencies [...] -c /.../src/main.cpp -o /.../build/src/XYZ.build/Release-iphoneos/XYZ.build/Objects-normal/armv7/main.o 3.4.1: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch armv7 [.....] -std=c++11 -fPIC -DVERSION=\"1.6.3+5-default-53920e4f2686\" -MMD -MT dependencies -c /.../src/main.cpp -o /.../build/src/XYZ.build/Release-iphoneos/XYZ.build/Objects-normal/armv7/main.o We use a little wrapper for quoted strings as XCode, windres and other compilers works different here. FUNCTION(GET_QUOTED_STRING _dest _str _filename) IF(CMAKE_GENERATOR STREQUAL Xcode) SET(tmp_var \\\\"${_str}\\\\") ELSEIF(NOT ${arg} MATCHES ".rc$") SET(tmp_var \\"${_str}\\") ELSE() SET(tmp_var ${_str}) ENDIF() SET(${_dest} ${tmp_var} PARENT_SCOPE) ENDFUNCTION() FUNCTION(ADD_STRING_DEFINITION _str _def) IF(ARGN) FOREACH(arg ${ARGN}) IF (${arg} MATCHES "^AppTargetName") SET(ARG_TYPE TARGET) ELSE() SET(ARG_TYPE SOURCE) ENDIF() IF(NOT "${_str}" STREQUAL "") GET_QUOTED_STRING(tmp_var ${_str} ${arg}) SET(tmp_var =${tmp_var}) ENDIF() SET_PROPERTY(${ARG_TYPE} ${arg} APPEND_STRING PROPERTY COMPILE_FLAGS " -D${_def}${tmp_var}") ENDFOREACH() ELSE() IF(NOT "${_str}" STREQUAL "") GET_QUOTED_STRING(tmp_var ${_str} ${arg}) SET(tmp_var =${tmp_var}) ENDIF() ADD_DEFINITIONS(-D${_def}${tmp_var}) ENDIF() ENDFUNCTION() FUNCTION(ADD_DEFINITION _def) ADD_STRING_DEFINITION("" ${_def} ${ARGN}) ENDFUNCTION() ########################################## PROJECT(XYZ VERSION 1.6.3 CXX) SET(VERSION_MERCURIAL ${PROJECT_VERSION}+5-default-53920e4f2686) ADD_STRING_DEFINITION(${VERSION_MERCURIAL} "VERSION" main.cpp) | |||||||||
| Tags | No tags attached. | |||||||||
| Relationships |
| |||||||||
| Attached Files | ||||||||||
| Issue History | ||||||||||
| Date Modified | Username | Field | Change | |||||||
| 2016-02-11 02:58 | A. Klitzing | New Issue | ||||||||
| 2016-02-11 08:25 | Brad King | Relationship added | related to 0015328 | |||||||
| 2016-02-11 08:27 | Brad King | Note Added: 0040470 | ||||||||
| 2016-02-11 09:42 | A. Klitzing | Note Added: 0040472 | ||||||||
| 2016-02-11 09:58 | Brad King | Note Added: 0040473 | ||||||||
| 2016-02-11 09:59 | Brad King | Status | new => resolved | |||||||
| 2016-02-11 09:59 | Brad King | Resolution | open => no change required | |||||||
| 2016-06-10 14:21 | Kitware Robot | Note Added: 0041255 | ||||||||
| 2016-06-10 14:21 | Kitware Robot | Status | resolved => closed | |||||||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||