101 lines
2.4 KiB
CMake
101 lines
2.4 KiB
CMake
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
|
|
project (SimCore VERSION 0.1.0 LANGUAGES CXX C)
|
|
set(CMAKE_MODULE_PATH ${CMAKE_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 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/Entity.hpp
|
|
src/SimCore/Entity.cpp
|
|
|
|
include/SimCore/Messages/Track.hpp
|
|
src/SimCore/Messages/Track.cpp
|
|
|
|
include/SimCore/Messages/Protos/Track.pb.cc
|
|
|
|
include/SimCore/Position.hpp
|
|
src/SimCore/Position.cpp
|
|
|
|
include/SimCore/SafeMap.hpp
|
|
src/SimCore/SafeMap.cpp
|
|
|
|
|
|
)
|
|
|
|
target_link_libraries(SimCore
|
|
whisper-com
|
|
loguru
|
|
libprotobuf
|
|
eigen
|
|
GeographicLib
|
|
)
|
|
# add_dependencies(SimCore protoc)
|
|
|
|
target_include_directories(SimCore PUBLIC
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
$<INSTALL_INTERFACE:include>
|
|
src)
|
|
|
|
|
|
# add_executable(main
|
|
|
|
# src/main.cpp
|
|
|
|
|
|
# )
|
|
|
|
|
|
# target_link_libraries(main
|
|
# Gateway
|
|
# CLI11
|
|
# loguru
|
|
# )
|
|
# target_include_directories(main PUBLIC
|
|
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
# $<INSTALL_INTERFACE:include>
|
|
# 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_TrackClass tests/test_TrackClass.cpp)
|
|
target_link_libraries(test_TrackClass Catch2::Catch2 SimCore eigen loguru)
|
|
catch_discover_tests(test_TrackClass)
|
|
|
|
add_executable(test_SafeMap tests/test_SafeMap.cpp)
|
|
target_link_libraries(test_SafeMap Catch2::Catch2 SimCore loguru)
|
|
catch_discover_tests(test_SafeMap)
|
|
|
|
ENDIF()
|