2022-02-28 20:35:05 +01:00
|
|
|
cmake_minimum_required(VERSION 3.13.0)
|
2022-02-25 11:34:42 +01:00
|
|
|
project(reboot-logic VERSION 0.1.0)
|
|
|
|
|
|
|
|
include(CTest)
|
2022-02-28 16:05:32 +01:00
|
|
|
find_package(Catch2 3)
|
|
|
|
if(NOT Catch2_FOUND)
|
|
|
|
include(FetchContent)
|
|
|
|
|
|
|
|
FetchContent_Declare(
|
|
|
|
Catch2
|
|
|
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
|
|
|
GIT_TAG v3.0.0-preview4
|
|
|
|
)
|
|
|
|
|
|
|
|
FetchContent_MakeAvailable(Catch2)
|
|
|
|
#fixes regression -preview4, to be confirmed in later releases
|
|
|
|
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
|
|
|
endif()
|
|
|
|
|
2022-02-25 11:34:42 +01:00
|
|
|
enable_testing()
|
|
|
|
|
2022-02-28 20:35:05 +01:00
|
|
|
add_executable(reboot-logic)
|
2022-02-28 14:13:31 +01:00
|
|
|
|
2022-02-28 20:35:05 +01:00
|
|
|
add_subdirectory(src)
|
2022-02-28 16:05:32 +01:00
|
|
|
target_link_libraries(reboot-logic PRIVATE Catch2::Catch2WithMain)
|
|
|
|
|
2022-02-25 11:34:42 +01:00
|
|
|
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
|
|
|
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
|
|
|
include(CPack)
|