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.
--
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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers