CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(c_demo01 C)
set(CMAKE_C_STANDARD 99)
# position of header file
include_directories(./includes xx/includes)
# 指定若干庫文件所在的目錄
link_directories(/Users/johnyu/temp/lib ./lib)
add_executable(${PROJECT_NAME} main.c)
# 指定庫的"相對"路徑+名字即可(libjohn.[dylib|so])
target_link_libraries(${PROJECT_NAME} john)