104 lines
2.6 KiB
CMake
104 lines
2.6 KiB
CMake
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
|
|
project (EntityLibrary 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 SimCore)
|
|
set(TEST_SIMCORE_LIBRARY OFF CACHE INTERNAL "")
|
|
add_subdirectory(libs/SimCore EXCLUDE_FROM_ALL)
|
|
ENDIF()
|
|
|
|
IF(NOT TARGET nlohmann_json)
|
|
set(JSON_BuildTests_INIT OFF CACHE INTERNAL "")
|
|
add_subdirectory(libs/nlohmannJSON EXCLUDE_FROM_ALL)
|
|
ENDIF()
|
|
|
|
IF(NOT TARGET kubecontrol)
|
|
set(TEST_KUBECONTROL_LIBRARY OFF CACHE INTERNAL "")
|
|
add_subdirectory(libs/KubeControl EXCLUDE_FROM_ALL)
|
|
ENDIF()
|
|
|
|
IF(NOT TARGET OrderLibrary)
|
|
# set(TEST_KUBECONTROL_LIBRARY OFF CACHE INTERNAL "")
|
|
add_subdirectory(libs/OrderLibrary EXCLUDE_FROM_ALL)
|
|
ENDIF()
|
|
|
|
|
|
|
|
add_library(EntityLibrary STATIC
|
|
|
|
|
|
include/Entities/Sensor.hpp
|
|
src/Entities/Sensor.cpp
|
|
|
|
include/Entities/Entity.hpp
|
|
src/Entities/Entity.cpp
|
|
|
|
include/Entities/Movement.hpp
|
|
src/Entities/Movement.cpp
|
|
|
|
|
|
include/Entities/Tracklist/Tracklist.hpp
|
|
src/Entities/Tracklist/Tracklist.cpp
|
|
|
|
include/Entities/Tracklist/TracklistItem.hpp
|
|
src/Entities/Tracklist/TrackListItem.cpp
|
|
)
|
|
|
|
|
|
target_link_libraries(EntityLibrary
|
|
SimCore
|
|
eigen
|
|
loguru
|
|
nlohmann_json
|
|
OrderLibrary
|
|
kubecontrol
|
|
)
|
|
# add_dependencies(SimCore protoc)
|
|
|
|
target_include_directories(EntityLibrary PUBLIC
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
$<INSTALL_INTERFACE:include>
|
|
src)
|
|
|
|
|
|
|
|
|
|
#
|
|
# Everything TEST related
|
|
#
|
|
option(TEST_ENTITIY_LIBRARY "Turn running of application template specific tests off" ON)
|
|
|
|
IF (${TEST_ENTITIY_LIBRARY})
|
|
|
|
|
|
|
|
add_executable(test_SensorClass tests/test_SensorClass.cpp)
|
|
target_link_libraries(test_SensorClass Catch2::Catch2 EntityLibrary loguru)
|
|
catch_discover_tests(test_SensorClass)
|
|
|
|
add_executable(test_EntityClass tests/test_EntityClass.cpp)
|
|
target_link_libraries(test_EntityClass Catch2::Catch2 EntityLibrary loguru)
|
|
catch_discover_tests(test_EntityClass)
|
|
|
|
|
|
add_executable(test_Tracklist tests/test_Tracklist.cpp)
|
|
target_link_libraries(test_Tracklist Catch2::Catch2 EntityLibrary loguru)
|
|
catch_discover_tests(test_Tracklist)
|
|
|
|
add_executable(test_TracklistItem tests/test_TracklistItem.cpp)
|
|
target_link_libraries(test_TracklistItem Catch2::Catch2 EntityLibrary loguru)
|
|
catch_discover_tests(test_TracklistItem)
|
|
|
|
|
|
add_executable(test_MovementClass tests/test_MovementClass.cpp)
|
|
target_link_libraries(test_MovementClass Catch2::Catch2 EntityLibrary loguru)
|
|
catch_discover_tests(test_MovementClass)
|
|
|
|
ENDIF()
|