...
This commit is contained in:
parent
407a805c30
commit
55d8d359b4
@ -1,5 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
# set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
@ -36,15 +38,18 @@ find_package(spdlog CONFIG)
|
||||
# set(SPDLOG_MASTER_PROJECT OFF)
|
||||
# set(SPDLOG_BUILD_EXAMPLE OFF)
|
||||
|
||||
set(spdlog_FOUND FALSE )
|
||||
# set(spdlog_FOUND FALSE )
|
||||
if (NOT spdlog_FOUND)
|
||||
message(STATUS "SPDLOG libarary was not found! Try to download it!")
|
||||
|
||||
include(FetchContent)
|
||||
include(ExternalProject)
|
||||
|
||||
# FetchContent_Declare(spdlog
|
||||
ExternalProject_Add(spdlog
|
||||
set(SPDLOG_USE_STD_FORMAT ON CACHE INTERNAL "Use of C++20 std::format")
|
||||
set(SPDLOG_FMT_EXTERNAL OFF CACHE INTERNAL "Turn off external fmt library")
|
||||
|
||||
FetchContent_Declare(spdlog
|
||||
# ExternalProject_Add(spdlog
|
||||
# SOURCE_DIR ${CMAKE_BINARY_DIR}/spdlog_lib
|
||||
# BINARY_DIR ${CMAKE_BINARY_DIR}/spdlog_lib/build
|
||||
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
|
||||
@ -55,13 +60,14 @@ if (NOT spdlog_FOUND)
|
||||
CMAKE_ARGS "-DSPDLOG_USE_STD_FORMAT=ON -DSPDLOG_FMT_EXTERNAL=OFF"
|
||||
# CONFIGURE_COMMAND ""
|
||||
# BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
# INSTALL_COMMAND ""
|
||||
# UPDATE_COMMAND ""
|
||||
# SOURCE_SUBDIR cmake
|
||||
# SOURCE_SUBDIR cmake # turn off building
|
||||
OVERRIDE_FIND_PACKAGE
|
||||
)
|
||||
# FetchContent_MakeAvailable(spdlog)
|
||||
# FetchContent_GetProperties(spdlog_lib SOURCE_DIR spdlog_SOURCE_DIR)
|
||||
# find_package(spdlog REQUIRED)
|
||||
find_package(spdlog CONFIG)
|
||||
endif()
|
||||
|
||||
option(WITH_TESTS "Build tests" ON)
|
||||
@ -84,5 +90,5 @@ add_library(${CNTR_PROTO_LIB} STATIC ${CNTR_PROTO_LIB_SRC})
|
||||
if (WITH_TESTS)
|
||||
set(CNTR_PROTO_TEST_APP cntr_proto_test)
|
||||
add_executable(${CNTR_PROTO_TEST_APP} tests/cntr_proto_test.cpp)
|
||||
target_link_libraries(${CNTR_PROTO_TEST_APP} ${CNTR_PROTO_LIB})
|
||||
target_link_libraries(${CNTR_PROTO_TEST_APP} ${CNTR_PROTO_LIB} spdlog::spdlog_header_only)
|
||||
endif()
|
||||
|
||||
@ -77,8 +77,7 @@ static constexpr std::array CONTROL_PROTO_VALID_COMMAND = {
|
||||
CONTROL_PROTO_STR_SLEW_YVEL, CONTROL_PROTO_STR_TRACK_XVEL, CONTROL_PROTO_STR_TRACK_YVEL,
|
||||
CONTROL_PROTO_STR_STOP, CONTROL_PROTO_STR_SITE_LON, CONTROL_PROTO_STR_SITE_LAT,
|
||||
CONTROL_PROTO_STR_SITE_ELEV, CONTROL_PROTO_STR_METEO_TEMP, CONTROL_PROTO_STR_METEO_PRES,
|
||||
CONTROL_PROTO_STR_METEO_HUM, CONTROL_PROTO_STR_NET_CONF,
|
||||
};
|
||||
CONTROL_PROTO_STR_METEO_HUM, CONTROL_PROTO_STR_NET_CONF};
|
||||
|
||||
class ControlProtoParser
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user