-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
40 lines (31 loc) · 943 Bytes
/
CMakeLists.txt
File metadata and controls
40 lines (31 loc) · 943 Bytes
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
cmake_minimum_required(VERSION 3.16)
project(ExerciseApp)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Import GoogleTest
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
FetchContent_MakeAvailable(googletest)
# Add library
add_library(my_lib
my_lib/FileGuard.cpp
my_lib/ResourcePool.cpp
)
target_include_directories(my_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
# Source files
file(GLOB SOURCES "src/*.cpp")
# Build executable
add_executable(ExerciseApp ${SOURCES})
# Link executable to library
target_link_libraries(ExerciseApp PRIVATE my_lib)
# Tests
#enable_testing()
#
#add_executable(calculator_test ${CMAKE_CURRENT_SOURCE_DIR}/tests/calculator_test.cpp)
#target_link_libraries(calculator_test PRIVATE my_lib GTest::gtest_main)
#
#include(GoogleTest)
#gtest_discover_tests(calculator_test)