-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (41 loc) · 1005 Bytes
/
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.0.0)
project(atm)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# GoogleTest requires at least C++11
set(CMAKE_CXX_STANDARD 11)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
# 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(
atm
Account.cxx
ATM.cxx
Bank.cxx
BaseDisplay.cxx
Main.cxx
)
target_include_directories(atm PRIVATE include)
if(CPPTEST_COVERAGE)
include(cpptest-coverage.cmake)
endif()
add_executable(
atm_test
Account.cxx
ATM.cxx
Bank.cxx
BaseDisplay.cxx
BankTest.cxx
)
target_include_directories(atm_test PRIVATE include)
target_link_libraries(
atm_test
gtest_main
)
include(GoogleTest)
gtest_discover_tests(atm_test XML_OUTPUT_DIR "${CMAKE_BINARY_DIR}/gtest-report")