forked from equalitie/cpp-upnp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cppupnp-config.cmake
47 lines (40 loc) · 1.1 KB
/
cppupnp-config.cmake
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
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.5)
project(CPPUPnP VERSION 1.0.0 LANGUAGES CXX)
if (NOT Boost_USE_STATIC_LIBS)
find_package(Threads REQUIRED)
find_package(Boost 1.74 REQUIRED COMPONENTS coroutine system)
set(THREAD_LIB "Threads::Threads")
else()
# When linking with static Boost, we need to link with libboost_thread.
find_package(Threads REQUIRED)
find_package(Boost 1.74 REQUIRED COMPONENTS thread coroutine system)
# Boost::thread adds Threads::Threads automatically
set(THREAD_LIB "Boost::thread")
endif()
add_library(cpp_upnp
STATIC
${CPPUPnP_DIR}/src/xml.cpp
${CPPUPnP_DIR}/src/igd.cpp
${CPPUPnP_DIR}/src/ssdp.cpp
${CPPUPnP_DIR}/src/url.cpp
${CPPUPnP_DIR}/src/parse_device.cpp
)
target_include_directories(cpp_upnp
PUBLIC
${CPPUPnP_DIR}/include
)
target_link_libraries(cpp_upnp
PUBLIC
Boost::system
Boost::coroutine
PRIVATE
${THREAD_LIB}
)
target_compile_features(cpp_upnp
PUBLIC
cxx_std_14
)
target_compile_options(cpp_upnp
PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-Wall>
)