-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
42 lines (33 loc) · 1.38 KB
/
CMakeLists.txt
File metadata and controls
42 lines (33 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0167 NEW)
project(LanDrop LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(r src/receiver.cpp)
add_executable(s src/sender.cpp)
if(WIN32)
target_compile_definitions(r PRIVATE _WIN32_WINNT=0x0A00)
target_compile_definitions(s PRIVATE _WIN32_WINNT=0x0A00)
# Windows (vcpkg sub-ports)
find_package(boost_asio CONFIG REQUIRED)
find_package(boost_system CONFIG REQUIRED)
target_link_libraries(r PRIVATE Boost::asio Boost::system)
target_link_libraries(s PRIVATE Boost::asio Boost::system)
else()
# macOS/Linux (Homebrew/system Boost)
find_package(Boost CONFIG REQUIRED)
if(TARGET Boost::headers)
target_link_libraries(r PRIVATE Boost::headers)
target_link_libraries(s PRIVATE Boost::headers)
elseif(TARGET Boost::boost)
target_link_libraries(r PRIVATE Boost::boost)
target_link_libraries(s PRIVATE Boost::boost)
elseif(DEFINED Boost_INCLUDE_DIRS)
target_include_directories(r PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(s PRIVATE ${Boost_INCLUDE_DIRS})
else()
message(FATAL_ERROR "Boost found but no usable include target/dirs were provided.")
endif()
# Do NOT require libboost_system on macOS/Homebrew:
# Boost.System is header-only in modern Boost; the stub library may be absent. :contentReference[oaicite:3]{index=3}
endif()