This commit is contained in:
2025-10-29 18:47:24 +03:00
parent 6a72ead855
commit 50e79aa0ae
18 changed files with 273 additions and 62 deletions

View File

@@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
find_package(ASIO QUIET)
if (ASIO_FOUND)
# message(STATUS "ASIO library was found")
message(STATUS "ASIO library was found in the host system")
else()
message(STATUS "ASIO library was not found! Try to download it!")
@@ -33,6 +33,26 @@ else()
find_package(ASIO)
endif()
find_package(cxxopts QUIET CONFIG)
if (cxxopts_FOUND)
message(STATUS "CXXOPTS library was found in the host system")
else()
message(STATUS "CXXOPTS library was not found! Try to download it!")
include(FetchContent)
include(ExternalProject)
FetchContent_Declare(cxxopts_lib
SOURCE_DIR ${CMAKE_BINARY_DIR}/cxxopts_lib
BINARY_DIR ${CMAKE_BINARY_DIR}
GIT_REPOSITORY "https://github.com/jarro2783/cxxopts.git"
GIT_TAG "v3.3.1"
GIT_SHALLOW TRUE
GIT_SUBMODULES ""
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(cxxopts_lib)
endif()
set(ASIBFM700_LIB_SRC asibfm700_common.h asibfm700_servocontroller.h asibfm700_servocontroller.cpp)
@@ -44,8 +64,14 @@ add_library(${ASIBFM700_LIB} STATIC ${ASIBFM700_LIB_SRC}
asibfm700_netserver.h
)
target_include_directories(${ASIBFM700_LIB} PRIVATE mcc spdlog ${ERFA_INCLUDE_DIR})
target_link_libraries(${ASIBFM700_LIB} PRIVATE mcc spdlog)
target_include_directories(${ASIBFM700_LIB} PUBLIC mcc spdlog ${ERFA_INCLUDE_DIR})
target_link_libraries(${ASIBFM700_LIB} mcc spdlog ${ERFA_LIBFILE})
set(ASIBFM700_NETSERVER_APP asibfm700_netserver)
add_executable(${ASIBFM700_NETSERVER_APP} asibfm700_netserver_main.cpp)
# target_include_directories(${ASIBFM700_NETSERVER_APP} PRIVATE mcc spdlog)
target_link_libraries(${ASIBFM700_NETSERVER_APP} PRIVATE mcc spdlog ${ASIBFM700_LIB})
option(WITH_TESTS "Build tests" ON)