-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (37 loc) · 1.65 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
cmake_minimum_required(VERSION 3.14)
project(FlappyBirds)
set(CXX_STANDARD_REQUIRED 20)
find_package(GTest REQUIRED)
set(FLAGS -Wall -Wextra -Werror -Wpedantic)
set(GMOCK_LIBRARIES /usr/lib/libgmock.a
/usr/lib/libgmock_main.a)
set(SFML_LIB sfml-graphics
sfml-window
sfml-system)
set(SRC Sprite.cpp
Moveable.cpp
Controllable.cpp
Pipes.cpp
PipesManager.cpp)
add_library(commonLibrary STATIC ${SRC})
add_executable(TestRunner testRunner.cpp)
target_link_libraries(TestRunner PRIVATE ${GTEST_LIBRARIES}
${GMOCK_LIBRARIES}
${SFML_LIB}
commonLibrary
pthread)
add_executable(FlappyBirds main.cpp)
target_link_libraries(FlappyBirds PRIVATE ${SFML_LIB}
commonLibrary)
target_compile_options(commonLibrary PRIVATE ${FLAGS})
target_compile_options(TestRunner PRIVATE ${FLAGS})
target_compile_options(FlappyBirds PRIVATE ${FLAGS})
set_target_properties(commonLibrary PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)
set_target_properties(TestRunner PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)
set_target_properties(FlappyBirds PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)