This repository has been archived on 2024-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
ecg-prog-filtered/u01/CMakeLists.txt
Simon Bruder fd230375ee u01: Allow both static and dynamic linking
This uses CMake’s BUILD_SHARED_LIBS variable, which by default is set to
OFF. To build the shared library and link the binaries against it, you
can set it to ON.
2023-05-09 23:25:03 +02:00

20 lines
422 B
CMake

cmake_minimum_required(VERSION 3.20)
project(ecg_tree)
add_library(tree node.cpp)
add_executable(main main.cpp)
target_link_libraries(main tree)
find_package(Catch2 3)
if(Catch2_FOUND)
add_executable(tests tests.cpp)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain tree)
include(CTest)
include(Catch)
catch_discover_tests(tests)
endif()
install(TARGETS main)
install(TARGETS tree DESTINATION lib)