Re: [hatari-devel] cmake and cross-compiling |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
On 27/12/2012 11:09, Christer Solskogen wrote:
Toolchain-mingw32.cmake uses CMAKE_FIND_ROOT_PATH in order to find its sysroot.
I really don't see why that is necessary since a proper cross compiler
will already have that set (using --with-sysroot= during build) - is
CMAKE_FIND_ROOT_PATH something that cmake really needs to cross
compile?
Hello
it's not the compiler that cmake doesn't find, it's the mingw version of
sdl, zlib, libpng and other libraries.
With CMAKE_FIND_ROOT_PATH :
-- Found SDL:
mingw32;/usr/i586-pc-mingw32/sys-root/mingw/lib/libSDLmain.a;/usr/i586-pc-mingw32/sys-root/mingw/bin/SDL.dll
-- Found MATH: /usr/i586-pc-mingw32/sys-root/mingw/lib/libm.a
-- Found READLINE: /usr/i586-pc-mingw32/sys-root/mingw/bin/readline.dll
-- Found ZLIB: /usr/i586-pc-mingw32/sys-root/mingw/lib/libz.dll.a (found
version "1.2.3")
-- Found PNG: /usr/i586-pc-mingw32/sys-root/mingw/lib/libpng.dll.a
(found version "1.2.35")
Without CMAKE_FIND_ROOT_PATH :
-- Found SDL: mingw32;/usr/lib/libSDLmain.a;/usr/lib/libSDL.a
-- Could NOT find MATH (missing: MATH_LIBRARY)
-- Could NOT find READLINE (missing: READLINE_LIBRARY)
-- Found ZLIB: /usr/lib/libz.a (found version "1.2.7")
-- Could NOT find PNG (missing: PNG_LIBRARY) (found version "1.5.13")
As you can see, the mingw versions of the libs are not found (or cmake
will use the host system ones, which is not good)
Maybe different linux distrib / cmake will give good results without
CMAKE_FIND_ROOT_PATH, but as it needed at least in this example, the
line is needed.
It seems cmake has some proper rules to find c/c++ compiler and linker,
but more "exotic" libs don't provide a definition file for cmake.
In your case, if you comment CMAKE_FIND_ROOT_PATH, does ./configure find
the mingw libs ?
Nicolas