[cmake-developers] Building with Qt for the Raspberry Pi with CMake
Stephen Kelly
steveire at gmail.com
Fri Apr 12 12:35:34 EDT 2013
Stephen Kelly wrote:
> I guess it works because libz.so and libz.so.1 are both in system paths?
> But then why doesn't the same work on the Raspberry Pi cross compile? The
> CMAKE_LIBRARY_ARCHITECTURE is already determined to be arm-linux-gnueabihf
> there.
I found out what the problem is. CMake doesn't add the sysroot to the link
line, so that's why the linker is not finding the library. It was searching
in my native root and not finding them.
set(CMAKE_CXX_LINK_FLAGS
"${CMAKE_CXX_LINK_FLAGS} --sysroot=${CMAKE_FIND_ROOT_PATH}")
Is there a reason CMake does not do something like the above already? Can we
add that?
Thanks,
Steve.
More information about the cmake-developers
mailing list