set( CMAKE_SYSTEM_NAME Linux )
set( CMAKE_SYSTEM_PROCESSOR arm )
set( CMAKE_C_COMPILER arm-linux-gnueabihf-gcc )
set( CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++ )
###########user defined#############
set( CMAKE_FIND_ROOT_PATH "/opt/lon/OpenCV-2.4.3/crosscompile_root" )
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
######################################[/quote]
好,cmake吧。
cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake ../
复制代码
然后再运行如下指令
cmake-gui
复制代码
减少一些没有用的项,如gtk、cude、1394等。其中CUDE,当时就困扰了我好一会儿呢。看人家怎么解释的:
[quote]"CUDA_TOOLKIT_ROOT_DIR not found or specified", CUDA is a parallel computing platform and programming model that enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU). It is only developed for NVdia GPU. However, it seems that not all PC will be equipped with that kind of GPU, theoretically, it is not necessary to install it and we make the option WITH_CUDA OFF. Also the opencv only support CUDA 4.0 now from the post bellow.
确认之后Config 并 General生成配置信息。
下面附上我的cmake配置信息:
[quote]Detected version of GNU GCC: 113 (113)
checking for module 'gstreamer-base-0.10'
package 'gstreamer-base-0.10' not found
checking for module 'libv4l1'
package 'libv4l1' not found
Looking for linux/videodev.h
Looking for linux/videodev.h - not found
Looking for linux/videodev2.h
Looking for linux/videodev2.h - found
Looking for libavformat/avformat.h
Looking for libavformat/avformat.h - not found
Looking for ffmpeg/avformat.h
Looking for ffmpeg/avformat.h - not found
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "2.7.3")
General configuration for OpenCV 2.4.3 =====================================
Platform:
Host: Linux 3.2.0-61-generic-pae i686
Target: Linux arm
CMake: 2.8.7
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: YES
codec: YES (ver 53.35.0)
format: YES (ver 53.21.1)
util: YES (ver 51.22.2)
swscale: YES (ver 2.1.0)
gentoo-style: YES
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
PvAPI: NO
GigEVisionSDK: NO
UniCap: NO
UniCap ucil: NO V4L/V4L2: NO/YES
XIMEA: NO
Xine: NO
Other third-party libraries:
Use TBB: NO
Use Cuda: NO
Use OpenCL: NO
Use Eigen: NO
Python:
Interpreter: /usr/bin/python (ver 2.7.3)
Tests and samples:
Tests: YES
Performance tests: YES
Examples: NO
Install path: /opt/lon/OpenCV-2.4.3/build/install
cvconfig.h is in: /opt/lon/OpenCV-2.4.3/build
-----------------------------------------------------------------
[quote]This folder contains libraries and headers of a few very popular still image codecs
used by highgui module.
The libraries and headers are preferably to build Win32 and Win64 versions of OpenCV.
On UNIX systems all the libraries are automatically detected by configure script.
In order to use these versions of libraries instead of system ones on UNIX systems you
should use BUILD_ CMake flags (for example, BUILD_PNG for the libpng library).