CMake设置交叉编译程序

SET(CMAKE_SYSTEM_NAME Linux)

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


)

可以在上述基础上添加更多的搜索路径。 

你可能感兴趣的:(CMake设置交叉编译程序)