initial commit
This commit is contained in:
84
CMakeLists.txt
Normal file
84
CMakeLists.txt
Normal file
@@ -0,0 +1,84 @@
|
||||
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(Entites STATIC
|
||||
|
||||
|
||||
include/Entities/Sensor.hpp
|
||||
src/Entities/Sensor.cpp
|
||||
|
||||
include/Entities/Entity.hpp
|
||||
src/Entities/Entity.cpp
|
||||
|
||||
)
|
||||
|
||||
|
||||
target_link_libraries(Entites
|
||||
SimCore
|
||||
loguru
|
||||
)
|
||||
# add_dependencies(SimCore protoc)
|
||||
|
||||
target_include_directories(Entites 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 SimCore loguru)
|
||||
catch_discover_tests(test_SensorClass)
|
||||
|
||||
add_executable(test_EntityClass tests/test_EntityClass.cpp)
|
||||
target_link_libraries(test_EntityClass Catch2::Catch2 SimCore loguru)
|
||||
catch_discover_tests(test_EntityClass)
|
||||
|
||||
|
||||
|
||||
ENDIF()
|
||||
Reference in New Issue
Block a user