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() add_compile_definitions(LOGURU_WITH_STREAMS SQLITE_THREADSAFE=2) IF(NOT TARGET loguru) set(LOGURU_STACKTRACES 0 CACHE BOOL "disable testing") add_subdirectory(libs/loguru EXCLUDE_FROM_ALL) ENDIF() add_library(DatabaseHelper STATIC include/DatabaseHelper.hpp src/DatabaseHelper.cpp ) target_link_libraries(DatabaseHelper loguru mariadbcpp ) # add_dependencies(SimCore protoc) target_include_directories(DatabaseHelper PUBLIC $ $ src) # # Everything TEST related # option(TEST_DB_LIBRARY "Turn running of application template specific tests off" ON) IF (${TEST_DB_LIBRARY}) add_executable(test_connections tests/test_connections.cpp) target_link_libraries(test_connections Catch2::Catch2 loguru DatabaseHelper ) catch_discover_tests(test_connections) ENDIF()