On Wed, Sep 21, 2011 at 12:41 PM, Daniel Dekkers <d.dekk...@cthrough.nl> wrote:
> Hi David,
>
>> I have tested it manually using the Xcode generator. The point of this
>> recent work was focused on getting "simulator" and "device" builds
>> both working within the same Xcode project at the same time, and
>> allowing the developer to switch back and forth between them in the
>> Xcode UI.
>>
>> There are *.xib files in this project, and they are included simply by
>> adding them as source files to add_executable.
>
> Ok, i've tried that and it works. But it seems I have to "label" the .xib 
> files first...
>
>                SET_SOURCE_FILES_PROPERTIES(
>                        ${RSRC_IOS_XIB_FILES}
>                        PROPERTIES
>                        MACOSX_PACKAGE_LOCATION Resources
>                )
>
> ... otherwise Xcode just seems to ignore the file (although it makes it 
> visible in the IDE).
> If i do "label" it, Xcode recognizes the file, compiles it and adds it to the 
> bundle in the first steps of the build process.
> So i deleted my own Cmake .xib compilation script.
>

Excellent -- good to know this was helpful.


> About the simulator and device builds... much to my surprise my toolchain 
> file for device works for the simulator as well (both iPad and iPhone).
>
> It looks like this:
>
>        MESSAGE(STATUS "Parsing iphone-device toolchain file")
>        SET (CMAKE_SYSTEM_NAME Generic)
>        SET (CMAKE_SYSTEM_VERSION 1)
>        SET (CMAKE_SYSTEM_PROCESSOR arm)
>
>        SET (SDKVER "4.3")
>        SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
>        SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
>        SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
>        SET (CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)") # Either 
> "$(ARCHS_UNIVERSAL_IPHONE_OS)" or "arm6" "arm7"
>
>        SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
>        SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
>
>        SET (CMAKE_FIND_ROOT_PATH "${IPHONE_SDKROOT}" 
> "/opt/iphone-${SDK_VER}/" "/usr/local/iphone-${SDK_VER}/")
>        SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
>        SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
>        SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
>
> I just include it at the moment. So i'm thinking to remove the 
> simulator/device distinction altogether and just add these settings to the 
> main CMakeLists.txt
> Although i do like the concept of cross-compiling and toolchain files very 
> much. With future android builds and all.
>

This is also good to know. I'd definitely recommend keeping that stuff
in the toolchain file rather than putting it directly in the
CMakeLists.txt file. One of these days I'm going to try out this
cross-compiling toolchain thing for my own personal edification... :-)

Let us know if you run into any problems.


Thanks,
David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to