-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
167 lines (140 loc) · 4.08 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
cmake_minimum_required(VERSION 3.15)
include(FetchContent)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CPACK_GENERATOR ZIP)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -v")
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
#set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}")
set(RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
Project (R-TYPE)
include(build/conanbuildinfo.cmake)
include(build/conan_paths.cmake)
conan_basic_setup()
find_package(SFML 2.5.1 COMPONENTS window graphics system network audio REQUIRED)
find_package(asio REQUIRED)
find_package(Threads REQUIRED)
find_package(Boost REQUIRED)
#todo: trouver un autre moyen parce que on compile pas sous linux avec le flag abi=0
if(CMAKE_COMPILER_IS_GNUCXX) # Pour régler le problème du sf:string:string undefined
#add_definitions("-std=c++17 -D_GLIBCXX_USE_CXX11_ABI=0")
endif(CMAKE_COMPILER_IS_GNUCXX)
#if(MSVC)
# add_compile_options(std:c++17)
#endif()
if (APPLE)
add_definitions(-DAPPLE)
elseif (WIN32)
add_definitions(-DWINDOWS)
add_definitions(-D_WIN32_WINNT=0x0A00)
endif (APPLE)
include_directories(
external/EngineCoreSuper/include
${CONAN_INCLUDE_DIRECTORIES}
)
add_subdirectory(external/EngineCoreSuper)
##### Files
FILE(GLOB_RECURSE SRCS_SERVER src/Server/*.cpp)
FILE(GLOB_RECURSE SRCS_CLIENT src/Client/*.cpp)
FILE(GLOB_RECURSE SRCS_SCENE src/Scene/*.cpp)
##### CLIENT
add_executable(Client-Rtype
${SRCS_CLIENT}
${SRCS_SCENE}
src/Network/UDPClient.cpp
src/Network/TCPClient.cpp
src/System/BackgroundSystem.cpp
src/System/ButtonSystem.cpp
src/System/ClientSystem.cpp
src/System/EnemySystem.cpp
src/System/KillSystem.cpp
src/System/PlayerSystem.cpp
src/System/TextSystem.cpp
)
target_include_directories(
Client-Rtype PUBLIC
${CONAN_INCLUDE_DIRECTORIES}
)
target_link_directories(
Client-Rtype
PRIVATE
external/EngineCoreSuper/build
)
target_link_libraries(
Client-Rtype
PRIVATE
${CONAN_LIBS}
EngineCoreSuper
)
##### SERVER
add_executable(Server-Rtype
${SRCS_SERVER}
${SRCS_NETWORK}
src/Network/UDPServer.cpp
src/Network/TCPServer.cpp
src/System/BackgroundSystem.cpp
src/System/ButtonSystem.cpp
src/System/ServerSystem.cpp
src/System/EnemySystem.cpp
src/System/KillSystem.cpp
src/System/PlayerSystem.cpp
src/System/TextSystem.cpp
)
target_include_directories(
Server-Rtype PUBLIC
${CONAN_INCLUDE_DIRECTORIES}
)
target_link_directories(
Server-Rtype PUBLIC
external/EngineCoreSuper/build
)
target_link_libraries(
Server-Rtype
${CONAN_LIBS}
EngineCoreSuper
)
# PAckaging
if (MSVC)
set(CPACK_GENERATOR "WIX")
set(CPACK_START_MENU_SHORTCUTS "R-Type")
set(CPACK_PACKAGE_EXECUTABLES "Client_RTYPE" "Serveur_RTYPE")
set(CPACK_PACKAGE_NAME "R-Type")
set(CPACK_PACKAGE_VENDOR "SUPA")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Shoot them up game")
configure_file("${CMAKE_SOURCE_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/license.txt" COPYONLY)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/license.txt")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/assets" DESTINATION bin)
install(TARGETS Client-Rtype
RUNTIME
DESTINATION bin
COMPONENT applications
)
install(TARGETS Server-Rtype
RUNTIME
DESTINATION bin
COMPONENT applications
)
else()
set(CPACK_GENERATOR "DEB")
set(CPACK_START_MENU_SHORTCUTS "R-Type")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Damien Demontis")
set(CPACK_PACKAGE_CONTACT "Damien Demontis")
set(CPACK_PACKAGE_EXECUTABLES "Client_RTYPE" "Serveur_RTYPE")
set(CPACK_PACKAGE_NAME "R-Type")
set(CPACK_PACKAGE_VENDOR "SUPA")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Shoot them up game")
configure_file("${CMAKE_SOURCE_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/license.txt" COPYONLY)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/license.txt")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/assets" DESTINATION bin)
install(TARGETS Client-Rtype
RUNTIME
DESTINATION bin
COMPONENT applications
)
install(TARGETS Server-Rtype
RUNTIME
DESTINATION bin
COMPONENT applications
)
endif ()
include(CPack)