cmake_minimum_required (VERSION 3.1 FATAL_ERROR) project (SimCore VERSION 0.1.0 LANGUAGES CXX C) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules) include(defaultOptions) IF(NOT TARGET Catch2) add_subdirectory(libs/Catch2 EXCLUDE_FROM_ALL) include(libs/Catch2/contrib/Catch.cmake) ENDIF() IF(NOT TARGET crossguid) set(CROSSGUID_TESTS OFF CACHE INTERNAL "") add_subdirectory(libs/crossguid EXCLUDE_FROM_ALL) ENDIF() IF(NOT TARGET eigen) set(EIGEN_BUILD_DOC OFF CACHE INTERNAL "") add_subdirectory(libs/eigen EXCLUDE_FROM_ALL) ENDIF() IF(NOT TARGET GeographicLib) # configure_file(${PROJECT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR}) add_subdirectory(libs/geographiclib EXCLUDE_FROM_ALL) ENDIF() IF(NOT TARGET whisper-com) add_subdirectory(libs/whisper-com EXCLUDE_FROM_ALL) ENDIF() protobuf_generate_cpp(PROTO_PATH include/SimCore/Messages/Protos CPP_PATH include/SimCore/Messages/Protos HPP_PATH include/SimCore/Messages/Protos) add_library(SimCore STATIC include/SimCore/Messages/SimTrack.hpp src/SimCore/Messages/SimTrack.cpp include/SimCore/Messages/Protos/SimTrack.pb.cc include/SimCore/Messages/Emission.hpp src/SimCore/Messages/Emission.cpp include/SimCore/Messages/Control.hpp src/SimCore/Messages/Control.cpp include/SimCore/Messages/Protos/Control.pb.cc include/SimCore/Messages/Protos/GeocentricPosition.pb.cc include/SimCore/Messages/Protos/Identifier.pb.cc include/SimCore/data.hpp include/SimCore/Position.hpp src/SimCore/Position.cpp include/SimCore/Orientation.hpp src/SimCore/Orientation.cpp include/SimCore/EulerConversion.hpp src/SimCore/EulerConversion.cpp include/SimCore/SafeMap.hpp src/SimCore/SafeMap.cpp include/SimCore/Identifier.hpp src/SimCore/Identifier.cpp include/SimCore/IdentifierMaker.hpp src/SimCore/IdentifierMaker.cpp include/SimCore/UtilFunctions.hpp src/SimCore/UtilFunctions.cpp ) target_link_libraries(SimCore whisper-com loguru libprotobuf eigen GeographicLib crossguid ) # add_dependencies(SimCore protoc) target_include_directories(SimCore PUBLIC $ $ src) # # Everything TEST related # option(TEST_SIMCORE_LIBRARY "Turn running of application template specific tests off" ON) IF (${TEST_SIMCORE_LIBRARY}) add_executable(test_PositionClass tests/test_PositionClass.cpp) target_link_libraries(test_PositionClass Catch2::Catch2 SimCore eigen loguru) catch_discover_tests(test_PositionClass) add_executable(test_OrientationClass tests/test_OrientationClass.cpp) target_link_libraries(test_OrientationClass Catch2::Catch2 SimCore eigen loguru) catch_discover_tests(test_OrientationClass) add_executable(test_GroundTruthTrackClass tests/test_GroundTruthTrackClass.cpp) target_link_libraries(test_GroundTruthTrackClass Catch2::Catch2 SimCore eigen loguru) catch_discover_tests(test_GroundTruthTrackClass) add_executable(test_SimTrack tests/test_SimTrack.cpp) target_link_libraries(test_SimTrack Catch2::Catch2 SimCore eigen loguru) catch_discover_tests(test_SimTrack) add_executable(test_RadarTrackClass tests/test_RadarTrackClass.cpp) target_link_libraries(test_RadarTrackClass Catch2::Catch2 SimCore loguru) catch_discover_tests(test_RadarTrackClass) add_executable(test_SafeMap tests/test_SafeMap.cpp) target_link_libraries(test_SafeMap Catch2::Catch2 SimCore loguru) catch_discover_tests(test_SafeMap) add_executable(test_IdentifierClass tests/test_IdentifierClass.cpp) target_link_libraries(test_IdentifierClass Catch2::Catch2 SimCore loguru) catch_discover_tests(test_IdentifierClass) add_executable(test_IdentifierList tests/test_IdentifierList.cpp) target_link_libraries(test_IdentifierList Catch2::Catch2 SimCore loguru) catch_discover_tests(test_IdentifierList) add_executable(test_UtilFunctions tests/test_UtilFunctions.cpp) target_link_libraries(test_UtilFunctions Catch2::Catch2 SimCore loguru) catch_discover_tests(test_UtilFunctions) add_executable(test_Trackstore tests/test_Trackstore.cpp) target_link_libraries(test_Trackstore Catch2::Catch2 SimCore loguru) catch_discover_tests(test_SensorClass) add_executable(test_DataClass tests/test_DataClass.cpp) target_link_libraries(test_DataClass Catch2::Catch2 SimCore loguru) catch_discover_tests(test_DataClass) add_executable(test_TrackClass tests/test_TrackClass.cpp) target_link_libraries(test_TrackClass Catch2::Catch2 SimCore loguru) catch_discover_tests(test_TrackClass) ENDIF()