...
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user