From f72c744d27913a350e1959eb9b9b776adb57410b Mon Sep 17 00:00:00 2001 From: Tian jianyong <11429339@qq.com> Date: Thu, 6 Feb 2025 17:26:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20CMakeLists.txt=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=20Boost=20=E7=9A=84=20chro?= =?UTF-8?q?no=E3=80=81date=5Ftime=E3=80=81atomic=20=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 869466d..37d619a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,14 @@ else() set(BOOST_ROOT "/opt/homebrew/Cellar/boost/1.87.0") set(BOOST_LIBRARYDIR "/opt/homebrew/Cellar/boost/1.87.0/lib") endif() -find_package(Boost 1.69.0 REQUIRED COMPONENTS system filesystem thread) +find_package(Boost 1.69.0 REQUIRED COMPONENTS + system + filesystem + thread + chrono + date_time + atomic +) # 添加 libcurl find_package(CURL REQUIRED) @@ -111,8 +118,9 @@ target_include_directories(${PROJECT_NAME}_lib target_link_libraries(${PROJECT_NAME}_lib PUBLIC Boost::system - nlohmann_json::nlohmann_json # 统一目标名称 + nlohmann_json::nlohmann_json CURL::libcurl + Threads::Threads ) # 创建主可执行文件 @@ -165,12 +173,11 @@ configure_file(${CMAKE_SOURCE_DIR}/config/airport_bounds.json ${CMAKE_BINARY_DIR configure_file(${CMAKE_SOURCE_DIR}/config/unmanned_vehicles.json ${CMAKE_BINARY_DIR}/config/unmanned_vehicles.json COPYONLY) # 查找 Threads 包 -find_package(Threads REQUIRED) +find_package(Threads REQUIRED) if(NOT APPLE) target_link_libraries(collision_avoidance PRIVATE ${PROJECT_NAME}_lib - Threads::Threads ) endif() \ No newline at end of file