[CMake] [PATCH] Qt cross compile with cmake v2.8.4

Markus Rathgeb maggu2810 at googlemail.com
Thu Mar 10 03:54:00 EST 2011


Hello!

First of all, the root filesystem is created with ptxdist (if it is
known to you).

>> I am using cmake for cross compiling of several Qt applications.
>> To do this with cmake v2.8.4 I have to change the FindQt4.cmake file.
>>
>> The variables QT_LIBRARY_DIR, QT_HEADERS_DIR, QT_BINARY_DIR (...) will
>> already be prefixed with the CMAKE_FIND_ROOT_PATH variable value.
>
> What do you mean already prefixed?  Are you setting them in the toolchain file?

CMAKE_FIND_ROOT_PATH and some other variables are defined.
No QT_... variables are set. This works fine "automatically".

>
>> For cross compiling CMAKE_FIND_ROOT_PATH_MODE_LIBRARY and
>> CMAKE_FIND_ROOT_PATH_MODE_INCLUDE should be set to ONLY (IMHO).
>>
>> FindQt4 is using NO_DEFAULT_PATH for finding libraries, headers and
>> binaries, so I had also to add NO_CMAKE_FIND_ROOT_PATH to that calls.
>>
>> Could you have a look at the attached patch?
>
> Can you send me the toolchain file also?

The file is attached and IMHO it is not overloaded.

>
> A few times in the past, users have submitted cross-compile patches for
> FindQt4.cmake and the end result was to simplify the toolchain files.

Sure, that is always a problem ;-)

So, I would be glad if you could have a look at the toolchain file and
we could improve cross compiling Qt projects with cmake.

Greats,
Markus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Toolchain-armv5te-linux-gnueabi.cmake
Type: text/x-cmake
Size: 1089 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110310/bc7e7cb8/attachment.bin>


More information about the CMake mailing list