[CMake] Cross-compiling on OS X/x86 for Linux/ARM, linking a library

Vladimir Lebedev-Schmidthof vlebedev at envionsoftware.com
Tue Oct 20 07:11:20 EDT 2009


Hello Alexander,

On Oct 19, 2009, at 23:18 PM, Alexander Neundorf wrote:
> > I set CMAKE_SYSTEM to Linux, even added "SET(APPLE 0)" but
> > install_name option is still generating.
>
> You should set "CMAKE_SYSTEM_NAME", not "CMAKE_SYSTEM" to "Linux".  
> If you
> really set CMAKE_SYSTEM instead of CMAKE_SYSTEM_NAME, this will fix  
> your
> problem (after a quick look it seems install_name is really only set  
> in the
> Modules/Platform/Darwin*.cmake files, which should not get loaded if
> CMAKE_SYSTEM_NAME is set to Linux).
>
I tried. Setting CMAKE_SYSTEM_NAME to "Linux" does not seem to affect  
CMAKE_SYSTEM
(i.e. adding

-----
SET(CMAKE_SYSTEM_NAME "Linux")

...

MESSAGE("CMAKE_SYSTEM_NAME is ${CMAKE_SYSTEM_NAME}")
MESSAGE("CMAKE_SYSTEM is ${CMAKE_SYSTEM}")
-----


results to

-----
CMAKE_SYSTEM_NAME is Linux
CMAKE_SYSTEM is Darwin-9.8.0
-----

Though

-----
SET(CMAKE_SYSTEM "Linux")
-----

results to

CMAKE_SYSTEM_NAME is Darwin
CMAKE_SYSTEM is Linux


So it seems that I have to set to Linux both variables. Anyway, cmake  
keeps adding install_name (and other Darwin-specific things) to linker  
options.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091020/4476edc9/attachment-0001.htm>


More information about the CMake mailing list