1、创建文件 touch main.c CMakeLists.txt
2、填入以下内容
cmake_minimum_required(VERSION 3.5.1)
project(app)
#set(CMAKE_SYSTEM_NAME Linux)
#set(CMAKE_SYSTEM_PROCESSOR arm)
#set(CMAKE_C_COMPILER /usr/local/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc)
#set(CMAKE_CXX_COMPILER /usr/local/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)
add_executable(app main.c minIni.c log.c)
target_link_libraries(app pthread)
3、cmake . 生成Makefile
4、make 生成可执行程序