在目标文件里新建build 、 include 、lib 文件夹,新建CMakeLists.txt 文件(即顶层CMakeLists.txt 文件)之后在每一个需要编译的文件夹中添加各自的底层CMakeLists.txt 文件。
如图所示:图中的bin文件夹,rootfs文件夹不需要自己创建
顶层CMakeLists.txt文件
cmake_minimum_required(VERSION 3.0.0)
project(1 VERSION 0.1.0)
include(CTest)
enable_testing()
#通过改变arm的值 是on 还是 off 来表示是否需要交叉编译
set(arm off)
if(${
arm