MantisBT - CMake
View Issue Details
0012597CMakeCMakepublic2011-11-29 06:042012-04-02 10:10
Hartmut Seichter 
Brad King 
highmajoralways
closedno change required 
CMake 2.8.6 
 
0012597: Makefile and Xcode generators adds bogus/hardcoded LD_FLAG values to iOS project file
Targeting iOS 5 from a Lion installation with Xcode 4.2.1 one cannot generate valid iOS project files.

Both, the Xcode and Makefile generators are adding LD_FLAG values that do not correspond to the selected SDK and compiler (CLang).
Attached a minimal example. Setting up the build system either for Makefiles or Xcode does add

" -Wl,-search_paths_first -Wl,-headerpad_max_install_names -arch armv6 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -miphoneos-version-min=4.0 "

In Xcode that can be overridden by using the info panel of the project but any change in the project brings it back.
No tags attached.
zip Minimal_iOS.zip (1,422) 2011-11-29 06:04
https://public.kitware.com/Bug/file/4126/Minimal_iOS.zip
Issue History
2011-11-29 06:04Hartmut SeichterNew Issue
2011-11-29 06:04Hartmut SeichterFile Added: Minimal_iOS.zip
2011-11-29 08:31Brad KingNote Added: 0027868
2011-11-29 08:31Brad KingStatusnew => resolved
2011-11-29 08:31Brad KingResolutionopen => no change required
2011-11-29 08:31Brad KingAssigned To => Brad King
2012-04-02 10:10David ColeNote Added: 0029052
2012-04-02 10:10David ColeStatusresolved => closed

Notes
(0027868)
Brad King   
2011-11-29 08:31   
In order to taget iOS you need to use a cross-compiling toolchain file:

http://www.cmake.org/Wiki/CMake_Cross_Compiling [^]
http://stackoverflow.com/questions/6476203/how-can-i-make-cmake-use-specific-compiler-and-flags-when-final-compilation-stag [^]
(0029052)
David Cole   
2012-04-02 10:10   
Closing resolved issues that have not been updated in more than 4 months.