This commit is contained in:
2025-07-04 12:24:34 +03:00
parent 08b582b895
commit b3b275edd8
10 changed files with 1342 additions and 47 deletions

View File

@@ -130,24 +130,22 @@ add_library(${MCC_LIBRARY} INTERFACE ${MCC_LIBRARY_SRC})
target_compile_features(${MCC_LIBRARY} INTERFACE cxx_std_23)
target_include_directories(${MCC_LIBRARY} INTERFACE ${FITPACK_INCLUDE_DIR})
set(MOUNT_SERVER_APP_SRC mount.h mount_state.h mount_server.cpp comm_server.h comm_server_endpoint.h comm_server_configfile.h mount_astrom.h
mount_astrom_default.h mcc_coord.h mount_pz.h mcc_fsm.h mcc_fsm_utils.h)
set(MOUNT_SERVER_APP mount_server)
add_executable(${MOUNT_SERVER_APP} ${MOUNT_SERVER_APP_SRC}
mcc_finite_state_machine.h
mcc_mount_events_states.h)
# target_include_directories(${MOUNT_SERVER_APP} PUBLIC ${ERFA_INCLUDE_DIR})
target_link_libraries(${MOUNT_SERVER_APP} ${CNTR_PROTO_LIB} spdlog::spdlog_header_only ERFA_LIB)
# set(MOUNT_SERVER_APP_SRC mount.h mount_state.h mount_server.cpp comm_server.h comm_server_endpoint.h comm_server_configfile.h mount_astrom.h
# mount_astrom_default.h mcc_coord.h mount_pz.h mcc_fsm.h mcc_fsm_utils.h mcc_finite_state_machine.h mcc_mount_events_states.h)
# set(MOUNT_SERVER_APP mount_server)
# add_executable(${MOUNT_SERVER_APP} ${MOUNT_SERVER_APP_SRC})
# # target_include_directories(${MOUNT_SERVER_APP} PUBLIC ${ERFA_INCLUDE_DIR})
# target_link_libraries(${MOUNT_SERVER_APP} ${CNTR_PROTO_LIB} spdlog::spdlog_header_only ERFA_LIB)
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} spdlog::spdlog_header_only)
# target_link_libraries(${CNTR_PROTO_TEST_APP} ${CNTR_PROTO_LIB})
# target_include_directories(${CNTR_PROTO_TEST_APP} PUBLIC ${SPDLOG_INCLUDE_DIRS})
# 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} spdlog::spdlog_header_only)
# # target_link_libraries(${CNTR_PROTO_TEST_APP} ${CNTR_PROTO_LIB})
# # target_include_directories(${CNTR_PROTO_TEST_APP} PUBLIC ${SPDLOG_INCLUDE_DIRS})
set(CFGFILE_TEST_APP configfile_test)
add_executable(${CFGFILE_TEST_APP} tests/configfile_test.cpp)
# set(CFGFILE_TEST_APP configfile_test)
# add_executable(${CFGFILE_TEST_APP} tests/configfile_test.cpp)
set(ASTROM_TEST_APP astrom_test)
add_executable(${ASTROM_TEST_APP} tests/astrom_test.cpp)
@@ -163,16 +161,16 @@ if (WITH_TESTS)
# add_executable(${FSM_TEST_APP} tests/fsm_test.cpp)
set(TESTS_SRC tests/coord.cpp tests/fsm.cpp tests/mount.cpp)
create_test_sourcelist(Tests common_tests.cpp ${TESTS_SRC})
add_executable(common_tests ${Tests})
target_include_directories(common_tests PRIVATE ${FITPACK_INCLUDE_DIR})
target_link_libraries(common_tests fitpack)
# set(TESTS_SRC tests/coord.cpp tests/fsm.cpp tests/mount.cpp)
# create_test_sourcelist(Tests common_tests.cpp ${TESTS_SRC})
# add_executable(common_tests ${Tests})
# target_include_directories(common_tests PRIVATE ${FITPACK_INCLUDE_DIR})
# target_link_libraries(common_tests fitpack)
foreach (test ${TESTS_SRC})
get_filename_component (TName ${test} NAME_WE)
add_test (NAME ${TName} COMMAND common_tests tests/${TName})
endforeach ()
# foreach (test ${TESTS_SRC})
# get_filename_component (TName ${test} NAME_WE)
# add_test (NAME ${TName} COMMAND common_tests tests/${TName})
# endforeach ()
enable_testing()
endif()