On Friday 12 April 2013, Stephen Kelly wrote:
> 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?
I don't think there's a reason that this is not done, except that nobody has
done it yet ;-)
So this should be somewhere inside a if(CMAKE_CROSSCOMPILING) in Linux-
GNU.cmake maybe ?
Alex
--
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