您的位置:首页 > 其它

记录一点关于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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: