[CMake] Cross compilation question

Steven Wilson steven.wesley.wilson at gmail.com
Tue Feb 15 16:52:02 EST 2011


In my CMake configuration files I have something like the following:


if(SYSTEM STREQUAL "iOS")
    set(CMAKE_C_COMPILER "foo" CACHE STRING "message" FORCE)
    set(CMAKE_CXX_COMPILER "bar" CACHE STRING "message" FORCE)
endif(SYSTEM STREQUAL "iOS")

Then when configuring the system I pass -DSYSTEM:STRING=iOS on the command
line (or through a GUI).

For my iOS system I use the makefile generator.

Steve


2011/2/15 Alexander Neundorf <a.neundorf-work at gmx.net>

> On Monday 14 February 2011, Steven Wilson wrote:
> > My apologies if this question has been asked and answered previously.
>  I
> > have a CMake system that I use for cross compilation for iOS software (ie
> > reset CMAKE_C_COMPILER, etc...).
>
> How do you do that ?
> You have to set CMAKE_C_COMPILER, CMAKE_CXX_COMPILER and CMAKE_SYSTEM_NAME.
> And they have to be set so that they stay the same later on, e.g. by using
> a "toolchain file".
>
> Do you do it that way or in some other way ?
>
> Do you use the makefile generator or xcode ?
>
> Alex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110215/f42c0eb4/attachment-0001.htm>


More information about the CMake mailing list