-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (41 loc) · 1.02 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
49
50
51
52
53
cmake_minimum_required(VERSION 3.5)
project("gilded-rose kata")
# Unit tests
# enable CTest testing
enable_testing()
include(FetchContent)
FetchContent_Declare(
cpputest
GIT_REPOSITORY [email protected]:cpputest/cpputest.git
GIT_TAG v4.0
GIT_SHALLOW 1
)
set(TESTS OFF CACHE BOOL "Switch off CppUTest Test build")
FetchContent_MakeAvailable(cpputest)
include_directories(${cpputest_SOURCE_DIR}/include)
add_executable(text-tests
GildedRoseTextTests.c
)
add_executable(unit-tests
GildedRoseUnitTests.cc
)
add_library(prod_lib
GildedRose_Quality.c
GildedRose_Internal.c
GildedRose.c)
target_link_libraries(text-tests
PRIVATE
prod_lib
CppUTest
)
target_link_libraries(unit-tests
PRIVATE
prod_lib
CppUTest
)
add_test(test_all
unit-tests
text-tests
)
target_compile_features(unit-tests PRIVATE c_std_99)
target_compile_features(text-tests PRIVATE c_std_99)