forked from coders-school/pizzas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
26 lines (18 loc) · 854 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
cmake_minimum_required(VERSION 3.11.0)
project(pizzas)
set(CMAKE_CXX_STANDARD 17)
set(SRC_LIST src/Funghi.cpp src/Margherita.cpp src/Pizza.cpp src/Pizzeria.cpp)
set(TEST_SRC_LIST test/test_main.cpp)
include(FetchContent)
FetchContent_Declare (googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG v1.14.0)
set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
include_directories(${CMAKE_SOURCE_DIR}/src)
link_libraries(gmock)
add_library(${PROJECT_NAME}-lib STATIC ${SRC_LIST} ${TEST_SRC_LIST})
add_executable(${PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}-lib)
add_executable(${PROJECT_NAME}-ut test/PizzeriaTest.cpp)
target_link_libraries(${PROJECT_NAME}-ut ${PROJECT_NAME}-lib)
enable_testing()
add_test(NAME someTests COMMAND ${PROJECT_NAME}-ut)