led_ctrl/CMakeLists.txt
2025-06-05 09:29:54 +08:00

37 lines
765 B
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

cmake_minimum_required(VERSION 3.10)
project(led_control)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 包含头文件目录
include_directories(${CMAKE_SOURCE_DIR}/include)
# 库文件目录
link_directories(${CMAKE_SOURCE_DIR}/lib)
# 查找src目录下所有cpp文件
file(GLOB SOURCES "src/*.cpp")
# 生成可执行文件
add_executable(led_app ${SOURCES})
# 链接需要的库
find_package(Threads REQUIRED)
target_link_libraries(led_app
PRIVATE
Threads::Threads
paho-mqttpp3
paho-mqtt3as
ssl
crypto
)
# 运行时动态库路径设置
set_target_properties(led_app PROPERTIES
BUILD_RPATH ${CMAKE_SOURCE_DIR}/lib
)
# 如果你toml11是以静态库形式存在或有其他依赖库记得这里添加