-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
48 lines (34 loc) · 1.89 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 3.16)
project(lime-tests LANGUAGES CXX)
# --------------------------------------------------------------------------------------------------------
# Create executable
# --------------------------------------------------------------------------------------------------------
add_executable(${PROJECT_NAME})
add_executable(lime::tests ALIAS ${PROJECT_NAME})
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED ON)
# --------------------------------------------------------------------------------------------------------
# Add Sources
# --------------------------------------------------------------------------------------------------------
file(GLOB src "*.test.cpp" "main.cpp")
target_sources(${PROJECT_NAME} PRIVATE ${src})
# --------------------------------------------------------------------------------------------------------
# Link Dependencies
# --------------------------------------------------------------------------------------------------------
include("../cmake/cpm.cmake")
CPMFindPackage(
NAME ut
VERSION 2.0.0
GIT_REPOSITORY "https://github.com/boost-ext/ut"
OPTIONS "BOOST_UT_DISABLE_MODULE ON"
)
target_link_libraries(${PROJECT_NAME} PRIVATE Boost::ut cr::lime)
# --------------------------------------------------------------------------------------------------------
# Shared Library
# --------------------------------------------------------------------------------------------------------
add_subdirectory(lib)
# --------------------------------------------------------------------------------------------------------
# Add Test-Target
# --------------------------------------------------------------------------------------------------------
include(CTest)
add_test(NAME lime-tests COMMAND $<TARGET_FILE:${PROJECT_NAME}>)