-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
70 lines (59 loc) · 1.29 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required(VERSION 3.19)
SET(CMAKE_CXX_STANDARD 17)
project(Battler)
add_executable(Battler
Battler.cpp
Expression.cpp
vm/Compiler.cpp
Parser.cpp
InterpreterErrors.cpp
vm/game.cpp
Battler.h
expression.h
interpreter_errors.h
Parser.h
Compiler.h
vm/game.h
)
set(TESTS_DEFAULT OFF)
option(TESTS "enable testing" ${TESTS_DEFAULT})
if (TESTS)
include(FetchContent)
if(WIN32)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
else()
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
DOWNLOAD_EXTRACT_TIMESTAMP true
)
endif()
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(
BattlerTester
tests/tests.cpp
Expression.cpp
vm/Compiler.cpp
Parser.cpp
InterpreterErrors.cpp
vm/game.cpp
Battler.h
expression.h
interpreter_errors.h
Parser.h
Compiler.h
vm/game.h
)
target_link_libraries(BattlerTester GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(
BattlerTester
DISCOVERY_MODE PRE_TEST
)
endif()