SET(TOOLCHAIN_DIR "/home/fuyajun/Public/toolchain/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686")
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/armv7a-mediatek451_001_vfp-linux-gnueabi-g++)
set(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/armv7a-mediatek451_001_vfp-linux-gnueabi-gcc)
set(GNU_FLAGS "-mfpu=vfp -fPIC")
set(CMAKE_CXX_FLAGS "${GNU_FLAGS} ")
set(CMAKE_C_FLAGS "${GNU_FLAGS} ")
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR}
${TOOLCHAIN_DIR}/armv7a-mediatek-linux-gnueabi/include
${TOOLCHAIN_DIR}/armv7a-mediatek-linux-gnueabi/lib
)
可以在上述基础上添加更多的搜索路径。
转载于:https://my.oschina.net/fuyajun1983cn/blog/263847