[CMake] cmake does not find modules when cross compiling

Gonçalo Bernardo goncalobernardo at gmail.com
Wed Aug 17 04:16:37 EDT 2011


Dear all,

I am using cmake and cmake-gui to cross-compile OpenCV. I wrote the
following toolchain file:

INCLUDE(CMakeForceCompiler)

SET(CMAKE_CROSSCOMPILING TRUE)

# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
SET(CMAKE_C_COMPILER
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH  /media/rootfs /media/rootfs/usr)

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

When i load this in cmake-gui i face some problems. the cross-compilers seem
to be correctly identified but not the packages installed in my rootfs. for
instance cmake-gui prints:

 checking for module 'libavcodec'

package 'libavcodec' not found

when libavcodec.so.52 is present in rootfs/usr/lib. The problem also happens
with gstreamer, ffmpeg,...

how can i find out which specific files is cmake looking for?
any other suggestion on this?

thanks in advance,
gonber
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110817/6f97894a/attachment.htm>


More information about the CMake mailing list