1. 安装eigen
sudo apt-get install libeigen3-dev
sudo apt-get install libsuitesparse-dev sudo apt-get install libqglviewer-dev
对于ARM版本,可以下载http://eigen.tuxfamily.org,之后放置在toolchain可以找到的三方库位置处,我使用的是eigne-3.2.8,这个版本需要qt4支持不是qt5
之后指明toolchain.cmake就可以顺利编译
#toolchain cmake file SET(CMAKE_SYSTEM_NAME Linux)
SET(TOOLCHAIN_DIR "/home/xx/softwares/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux") SET(3RDPART_LIBS_DIR "/home/xx/install")
#specify the cross compiler SET(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-gcc CACHE FILEPATH "Archiver") SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-g++ CACHE FILEPATH "Archiver") #SET(CMAKE_GFORTRAN ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-gfortran) SET(CMAKE_AR ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-ar CACHE FILEPATH "Archiver") SET(CMAKE_AS ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-as CACHE FILEPATH "Archiver") SET(CMAKE_LD ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-ld CACHE FILEPATH "Archiver") SET(CMAKE_NM ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-nm CACHE FILEPATH "Archiver") SET(CMAKE_STRIP ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-strip CACHE FILEPATH "Archiver") # where is the target environment SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR} ${3RDPART_LIBS_DIR}) # 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)