-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (33 loc) · 1.52 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
cmake_minimum_required(VERSION 3.14)
project(AdventureGame)
set(CXX_STANDARD_REQUIRED 20)
set(FLAGS -Wall -Wextra -Werror -Wpedantic)
find_package(GTest REQUIRED)
set(SFML_LIB sfml-graphics
sfml-window
sfml-system)
set(SRC Source/Sprite.cpp
Source/Item.cpp
Source/Inventory.cpp
Source/Moveable.cpp
Source/Controllable.cpp)
add_library(${PROJECT_NAME}-lib STATIC ${SRC})
add_executable(${PROJECT_NAME} main.cpp)
add_executable(TestRunner testRunner.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE ${SFML_LIB}
${PROJECT_NAME}-lib)
target_link_libraries(TestRunner PRIVATE ${PROJECT_NAME}-lib
${GTEST_LIBRARIES}
${SFML_LIB})
target_compile_options(${PROJECT_NAME}-lib PRIVATE ${FLAGS})
target_compile_options(${PROJECT_NAME} PRIVATE ${FLAGS})
target_compile_options(TestRunner PRIVATE ${FLAGS})
set_target_properties(${PROJECT_NAME}-lib PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)
set_target_properties(TestRunner PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)