-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (47 loc) · 1.95 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 3.17)
project(evolution_project)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
#add_compile_options(-O3 -Wall -Werror -Wformat-security -Wignored-qualifiers -Winit-self
# -Wswitch-default -Wfloat-equal -Wshadow -Wpointer-arith -Wtype-limits -Wempty-body
# -Wmissing-field-initializers -Wctor-dtor-privacy -Wnon-virtual-dtor
# -Wold-style-cast -Woverloaded-virtual -Wsign-promo -Weffc++)
add_compile_options(-O3)
find_package(SFML 2.5 COMPONENTS graphics REQUIRED)
#list(APPEND CMAKE_PREFIX_PATH "/opt/grpc" "/opt/protobuf")
# Cmake find modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(Protobuf REQUIRED)
find_package(GRPC REQUIRED)
set(PROTOS server/server.proto)
set(PROTO_SRC_DIR proto-src)
file(MAKE_DIRECTORY ${PROTO_SRC_DIR})
include_directories(${PROTO_SRC_DIR})
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_SRC_DIR} ${PROTOS})
grpc_generate_cpp(GRPC_SRCS GRPC_HDRS ${PROTO_SRC_DIR} ${PROTOS})
include_directories(include)
include(CMakeRC.cmake)
cmrc_add_resource_library(resources WHENCE resources resources/times.ttf resources/card.png)
add_executable(${PROJECT_NAME}
source/button.cpp
source/animal.cpp
source/deck.cpp
source/game.cpp
source/player.cpp
source/game_window.cpp
source/view.cpp
source/main.cpp
source/development_phase.cpp
source/feeding_phase.cpp
source/cards.cpp
source/start_windows.cpp
source/properties.cpp
source/text_field.cpp source/settings.cpp
${PROTO_SRCS}
${GRPC_SRCS})
include_directories(include)
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
set(SFML_DIR "SFML-2.5.1-macos-clang/include/SFML")
set(SFML_STATIC_LIBRARIES TRUE)
target_link_libraries(evolution_project sfml-graphics sfml-audio resources gRPC::grpc++_reflection
protobuf::libprotobuf)