kazbek/CMakeLists.txt

32 lines
994 B
CMake

cmake_minimum_required(VERSION 3.21)
project(Katja)
include(CTest)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_CXX_STANDARD 17)
find_package(Boost CONFIG COMPONENTS unit_test_framework REQUIRED)
add_library(backend
katja/database.cpp include/katja/database.hpp
katja/sbo.cpp include/katja/sbo.hpp
katja/repository.cpp include/katja/repository.hpp
)
target_include_directories(backend PRIVATE include ${Boost_INCLUDE_DIR})
add_executable(katja cli/main.cpp)
target_include_directories(katja PRIVATE include ${Boost_INCLUDE_DIR})
target_link_libraries(katja LINK_PUBLIC backend)
if(BUILD_TESTING)
add_executable(tester tests/tester.cpp)
target_include_directories(tester PRIVATE include ${Boost_INCLUDE_DIR})
target_compile_definitions(tester PRIVATE "BOOST_TEST_DYN_LINK=1")
target_link_libraries(tester LINK_PRIVATE backend Boost::unit_test_framework)
add_test(NAME tester COMMAND tester)
endif()