Is it possible to construct build environment for cross-compiling for different target environment?

94 views Asked by At

In these days, I'm learning joy of open-source world. With Homebrew package build management system on Mac OS X. Building software for my purpose was so easy and simple.

Anyway, those package systems are designed for host system only. If I want to build a library (for an example OpenCV) for other system (for an example, iOS, Android or Ubuntu), is there any option?

*The cross-compile means compiling for target system B on host system A.

2

There are 2 answers

1
Alex F On

See CMake project: http://www.cmake.org/

0
Andrey Kamaev On

OpenCV already has ports to Android and iOS - Android port is officially released with OpenCV 2.3.1; iOS port is currently available in OpenCV trunk only.

Both ports are using cmake for cross-compiling. You can download the sources and see how this is done. Instructions for building Android port are available on OpenCV wiki