cmake_minimum_required(VERSION 3.16)
project(cmake_test)
set(CMAKE_CXX_STANDARD 17)
# 头文件搜索路径
include_directories(${PROJECT_SOURCE_DIR}/includes/facer)
include_directories(${PROJECT_SOURCE_DIR}/src)
# 源文件搜索路径
aux_source_directory(${PROJECT_SOURCE_DIR}/src SRC_LIST)
# 共享库搜索路径
link_libraries(${PROJECT_SOURCE_DIR}/libs/facer)
add_executable(cmake_test main.cpp ${SRC_LIST})
# 指定链接库名称
target_link_libraries(${PROJECT_NAME} facer)
作者:张风捷特烈
链接:https://juejin.cn/post/7125738805159542814
来源:稀土掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
标签:PROJECT,cmake,libraries,学习,SOURCE,facer,CMake,DIR
From: https://www.cnblogs.com/xunevermore/p/17203733.html