4
4
cmake_minimum_required (VERSION 3.14)
5
5
project (final_fight)
6
6
set (CMAKE_CXX_STANDARD 17)
7
- #set(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++")
7
+
8
+ #[[
9
+ Para hacer profiling.
10
+ ]]
11
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3" )
12
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3" )
8
13
9
14
#[[
10
15
Compilar la test suite de Google.
@@ -43,7 +48,7 @@ endif()
43
48
44
49
# Se agrega los cmake de sdl2-image
45
50
# https://github.com/trenki2/SDL2Test
46
- set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR} /vendor/cmake-sl2-image/" )
51
+ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR} /vendor/cmake-sl2-image/" " ${CMAKE_SOURCE_DIR} /vendor/cmake-sdl-mixer/" )
47
52
48
53
#[[
49
54
Para que funcione pthread.
@@ -53,43 +58,35 @@ SET(CMAKE_CXX_FLAGS -pthread)
53
58
#[[
54
59
Definición de variables.
55
60
]]
56
- FILE (GLOB TestSources test /*.cpp)
57
- FILE (GLOB ModelSources modelo/*.cpp)
58
- FILE (GLOB ModelMapSources modelo/mapeables/*.cpp)
59
- FILE (GLOB MainSources main/*.cpp)
60
- FILE (GLOB PhysicsSources fisica/*.cpp)
61
- FILE (GLOB GraphicsSources graficos/*.cpp)
62
- FILE (GLOB InputSources comportamiento/*.cpp)
63
- FILE (GLOB IASources estados/ia/*.cpp)
64
- FILE (GLOB StatesSources estados/*.cpp)
65
- FILE (GLOB ServicesSources servicios/*.cpp)
66
- FILE (GLOB LevelSources niveles/*.cpp)
67
- FILE (GLOB Configurations *.xml)
68
- FILE (GLOB AnimationFactoriesSources graficos/animaciones/*.cpp)
61
+ FILE (GLOB_RECURSE TestSources test /*.cpp)
62
+ FILE (GLOB_RECURSE ModelSources modelo/*.cpp)
63
+ FILE (GLOB_RECURSE PhysicsSources fisica/*.cpp)
64
+ FILE (GLOB_RECURSE GraphicsSources graficos/*.cpp)
65
+ FILE (GLOB_RECURSE InputSources comportamiento/*.cpp)
66
+ FILE (GLOB_RECURSE StatesSources estados/*.cpp)
67
+ FILE (GLOB_RECURSE ServicesSources servicios/*.cpp)
68
+ FILE (GLOB_RECURSE Configurations *.xml)
69
69
FILE (GLOB_RECURSE ClientSources cliente/*.cpp)
70
70
FILE (GLOB_RECURSE ServerSources servidor/*.cpp)
71
71
FILE (GLOB_RECURSE EventSources eventos/*.cpp)
72
- FILE (GLOB_RECURSE SerializeSources serializar/*.cpp)
73
72
FILE (GLOB_RECURSE UsuarioSources usuario/*.cpp)
73
+ FILE (GLOB_RECURSE UtilsSources utils/*.cpp)
74
+ FILE (GLOB_RECURSE SoundSources sonidos/*.cpp)
74
75
75
76
find_package (SDL2 REQUIRED) # Find SDL2 libraries.
76
77
find_package (XercesC REQUIRED) # Find Xerces
77
78
find_package (SDL2_image REQUIRED) # Find SDL2-IMAGE libraries
78
79
find_package (SDL2TTF REQUIRED)
79
- include_directories (${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} )
80
+ find_package (SDL2_mixer REQUIRED)
81
+ include_directories (${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} ${SDL2_MIXER_INCLUDE_DIR} )
80
82
81
83
#[[
82
84
Compilar los tests.
83
85
]]
84
- add_executable (tests ${TestSources} ${ModelSources} ${GraphicsSources} ${ModelMapSources} ${ InputSources} ${StatesSources} ${ServicesSources} ${SpriteSources} ${ PhysicsSources} ${LevelSources} ${ IASources} ${AnimationFactoriesSources} ${SerializeSources} ${SerializeSources } ${UsuarioSources} )
86
+ add_executable (tests ${TestSources} ${ModelSources} ${GraphicsSources} ${InputSources} ${StatesSources} ${ServicesSources} ${PhysicsSources} ${IASources} ${UsuarioSources} )
85
87
target_link_libraries (tests gtest_main gmock_main ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2TTF_LIBRARY} ${XercesC_LIBRARIES} )
86
88
add_test (NAME model_tests COMMAND model_tests)
87
89
88
- #[[
89
- Compilar el juego.
90
- target_link_libraries(${CMAKE_PROJECT_NAME} LINK_PUBLIC ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2TTF_LIBRARY} ${XercesC_LIBRARIES})
91
- ]]
92
-
93
90
#[[
94
91
Copiar los assets
95
92
]]
@@ -99,12 +96,11 @@ file(COPY ${Configurations} DESTINATION ${CMAKE_BINARY_DIR})
99
96
#[[
100
97
Compilar el cliente.
101
98
]]
102
- add_executable (cliente ${ClientSources} ${ServicesSources} ${ ModelSources} ${GraphicsSources} ${SpriteSources } ${ModelMapSources } ${ServicesSources } ${AnimationFactoriesSources} main/Juego .cpp ${SerializeSources} ${UsuarioSources} )
103
- target_link_libraries (cliente ${XercesC_LIBRARIES} ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2TTF_LIBRARY} )
99
+ add_executable (cliente ${ClientSources} ${ModelSources} ${GraphicsSources} ${ServicesSources } ${UsuarioSources } ${UtilsSources } ${SoundSources} modelo/serializables/Arma .cpp modelo/serializables/Arma.h )
100
+ target_link_libraries (cliente ${XercesC_LIBRARIES} ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2TTF_LIBRARY} ${SDL2_MIXER_LIBRARY} )
104
101
105
102
#[[
106
103
Compilar el servidor.
107
104
]]
108
-
109
- add_executable (servidor ${ServerSources} ${ServicesSources} ${EventSources} ${ModelSources} ${IASources} ${SerializeSources} ${StatesSources} ${PhysicsSources} ${UsuarioSources} )
105
+ add_executable (servidor ${ServerSources} ${ServicesSources} ${EventSources} ${ModelSources} ${StatesSources} ${PhysicsSources} ${UsuarioSources} ${UtilsSources} servidor/notificadores/NotificadorDeGolpesJugador.cpp servidor/notificadores/NotificadorDeGolpesJugador.h)
110
106
target_link_libraries (servidor ${XercesC_LIBRARIES} )
0 commit comments