On Wed, 17. Mar 2010, 20:58:11 -0500, Omar Andrés Zapata Mesa wrote:
> I am working with cmake in big project with qt4 any months ago, and I want
> compile windows software into my debian system,
> how I can tell to cmake that find my new enviroment? or have your some
> cmake.find file? o what your suggest me?
Generic cross compilation instructions for CMake can be found here:
http://www.cmake.org/Wiki/CMake_Cross_Compiling
You have to set various options to tell CMake what kind of system you
want to compile for and where to find the proper include and l so muchibrary
files.
Mingw-cross-env uses this for the OpenSceneGraph package, see
src/openscenegraph.mk.
If you have Mingw-cross-env installed in e.g. /MCE, then you would use
something like this:
cmake . \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_FIND_ROOT_PATH=/MCE/usr/i686-pc-mingw32 \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_C_COMPILER=/MCE/usr/bin/i686-pc-mingw32-gcc' \
-DCMAKE_INCLUDE_PATH=/MCE/usr/i686-pc-mingw32/include \
-DCMAKE_LIB_PATH=/MCE/usr/i686-pc-mingw32/lib \
-DPKG_CONFIG_EXECUTABLE=/MCE/usr/bin/i686-pc-mingw32-pkg-config
However, the project might still use some CMake macros or scripts that
do not support cross compilation and need to be fixed manually.
Martin