修改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

本文详细介绍了如何通过修改CMakeLists.txt文件,将HYDRA软件成功移植到OP平台上,包括设置系统类型、指定编译器、配置目标环境路径等关键步骤。

387

被折叠的 条评论
为什么被折叠?



