-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
58 lines (43 loc) · 1.15 KB
/
CMakeLists.txt
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
48
49
50
51
52
53
54
55
56
57
58
cmake_minimum_required(VERSION 3.24)
project(bemos-modbus VERSION 2.3.0)
set(MAIN_EXECUTABLE bemos_modbus)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libs/bone_helper/cpm")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libs/bone_helper/cmake")
set(Boost_USE_STATIC_LIBS ON)
include(pre)
option(USE_SYSTEM_SSL "Use system OpenSSL instead of bundled" ON)
if(NOT USE_SYSTEM_SSL)
include(openssl)
endif()
include(fmt)
include(spdlog)
include(bone_helper)
include(add_cxxopts)
include(json)
if(BUILD_TESTS)
include(catch)
endif()
add_executable(${MAIN_EXECUTABLE}
src/bemos_modbus.cpp
)
add_library(version src/version.cpp)
add_dependencies(version version_header)
find_package(PkgConfig)
pkg_check_modules(modbus REQUIRED "libmodbus")
target_include_directories(${MAIN_EXECUTABLE} PRIVATE
include
${modbus_INCLUDE_DIRS}
)
target_include_directories(version PRIVATE include)
target_link_libraries(version PRIVATE fmt common_compile_options)
target_link_libraries(${MAIN_EXECUTABLE} PRIVATE
common_compile_options
version
fmt
spdlog
bone_helper
cxxopts
nlohmann_json::nlohmann_json
${modbus_LINK_LIBRARIES}
)
include(post)