记录一点关于CMAKE的交叉编译
2014-10-08 22:57
323 查看
修改CMakeLists.txt,添加以下于开头,成功移植HYDRA到OP上了,爽
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER mipsel-openwrt-linux-gcc)
SET(CMAKE_CXX_COMPILER mipsel-openwrt-linux-g++)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /router/OpenWrt-Toolchain-brcm47xx-for-mipsel_74kc+dsp2-gcc-4.8-linaro_uClibc-0.9.33.2/toolchain-mipsel_74kc+dsp2_gcc-4.8-linaro_uClibc-0.9.33.2)
# 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)
===================================================
详情参考官方:
http://www.cmake.org/Wiki/CMake_Cross_Compiling
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER mipsel-openwrt-linux-gcc)
SET(CMAKE_CXX_COMPILER mipsel-openwrt-linux-g++)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /router/OpenWrt-Toolchain-brcm47xx-for-mipsel_74kc+dsp2-gcc-4.8-linaro_uClibc-0.9.33.2/toolchain-mipsel_74kc+dsp2_gcc-4.8-linaro_uClibc-0.9.33.2)
# 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)
===================================================
详情参考官方:
http://www.cmake.org/Wiki/CMake_Cross_Compiling
相关文章推荐
- cmake 配置交叉编译工作记录
- 关于在FC6中安装m68k-elf-tools交叉编译碰到的问题及解决方法
- [编译记录]关于编译器错误C2885...
- 关于Delphi使用TPerlRegEx控件编译时出现Internal Error:l3576的一点发现
- 关于const与指针搭配使用的一点记录
- 调试记录-关于#include与#include在64位编译时的问题
- sqlite-3.3.6编译安装与交叉编译全过程详细记录
- 关于自动编译的一点经验
- 记录关于APUE的编译方法
- 关于最近布线的一点记录
- 关于C语言include的一点记录
- 关于交叉编译器arm-linux-gcc-3.3.2.tar.bz2 建立交叉编译环境
- 关于页面编码问题的一点记录
- 关于管理培训的一点心得记录
- 关于ipad一点记录
- ubuntu 8.04中编译ARM交叉平台的一点心得!
- 关于weka的TextDirectoryLoader 的一点记录
- Ubuntu下交叉编译tslib-1.4记录
- 交叉编译中关于ARM的选项
- 关于jquery选择器的一点认识,记录下来,以供日后查阅