Zitat von Giampiero Salvi <gia...@kth.se>:
I have a project that builds fine both on Linux and on mingw32 using
cmake version 2.6-patch 2.

Now, I am trying to cross compile my project on a Linux (Ubuntu 9.04)
machine for the target Windows platform using the mingw32 cross
compiler. I have a toolchain more or less copied from
http://www.itk.org/Wiki/CmakeMingw that looks like this:
[...]
I get the error:

CMake Error at /usr/share/cmake-2.6/Modules/FindSWIG.cmake:55 (MESSAGE):
  SWIG was not found.  Please specify Swig executable location

This is caused by CMAKE_FIND_ROOT_PATH_MODE_INCLUDE not only affecting include files but all files found with find_path() or find_file(). FindSWIG.cmake needs a NO_CMAKE_FIND_ROOT_PATH at the end of the find_path() call since it will most likely always be the one on the host (any other will give you wrong paths). The find_program() on top of it definitely needs a NO_CMAKE_FIND_ROOT_PATH as it is used for execution just below of that.

Not all cmake modules are ready to be used for cross-compiling and some probably will never (e.g. FindQt4.cmake).

HS


_______________________________________________
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