86 lines
1.9 KiB
CMake
86 lines
1.9 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 SimCore)
|
|
set(TEST_SIMCORE_LIBRARY OFF CACHE INTERNAL "")
|
|
add_subdirectory(libs/SimCore 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(EntityLibrary STATIC
|
|
|
|
|
|
include/Entities/Sensor.hpp
|
|
src/Entities/Sensor.cpp
|
|
|
|
include/Entities/Entity.hpp
|
|
src/Entities/Entity.cpp
|
|
|
|
)
|
|
|
|
|
|
target_link_libraries(EntityLibrary
|
|
SimCore
|
|
loguru
|
|
)
|
|
# add_dependencies(SimCore protoc)
|
|
|
|
target_include_directories(EntityLibrary 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_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 Entities loguru)
|
|
catch_discover_tests(test_SensorClass)
|
|
|
|
add_executable(test_EntityClass tests/test_EntityClass.cpp)
|
|
target_link_libraries(test_EntityClass Catch2::Catch2 Entities loguru)
|
|
catch_discover_tests(test_EntityClass)
|
|
|
|
add_executable(test_EntityImplementation tests/test_EntityImplementation.cpp)
|
|
target_link_libraries(test_EntityImplementation Entities loguru)
|
|
|
|
ENDIF()
|