@@ -142,7 +142,6 @@ endif()
142
142
#include(SuperTux/ProvideTinygettext)
143
143
#include(SuperTux/ProvideSDL2_ttf) # add back?
144
144
145
-
146
145
# Find dependencies
147
146
find_package (SDL2 CONFIG REQUIRED)
148
147
#find_package(PNG CONFIG REQUIRED)
@@ -162,6 +161,7 @@ include(SuperTux/ProvideDiscord)
162
161
include (SuperTux/ProvideSexpcpp)
163
162
include (SuperTux/ProvidePartioZip)
164
163
include (SuperTux/ProvideOpenGL)
164
+ include (SuperTux/ProvideTinygettext)
165
165
166
166
## Build stuff
167
167
include (SuperTux/BuildVersion)
@@ -187,76 +187,74 @@ list(SORT SUPERTUX_RESOURCES)
187
187
include (SuperTux/CompileAmalgation)
188
188
189
189
## Generate supertux executable in the right place
190
-
190
+ # Is this needed? - Swagtoy
191
191
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
192
- set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR} )
192
+ # set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
193
193
194
194
## Add target for supertux binary
195
195
196
- add_library (supertux2_c OBJECT ${SUPERTUX_SOURCES_C} )
197
- add_library (supertux2_lib STATIC ${CMAKE_BINARY_DIR} /version .h ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_RESOURCES} $<TARGET_OBJECTS:supertux2_c>)
198
- target_include_directories (supertux2_lib PUBLIC ${CMAKE_BINARY_DIR} src/)
199
-
200
- if (WIN32 )
201
- add_executable (supertux2 WIN32 src/main.cpp ${CMAKE_CURRENT_SOURCE_DIR} /data/images/engine/icons/supertux.rc)
202
- target_link_libraries (supertux2 LibSDL2main)
203
- else ()
204
- add_executable (supertux2 src/main.cpp)
205
- endif ()
206
- target_link_libraries (supertux2 supertux2_lib)
196
+ add_executable (supertux2 WIN32 ${CMAKE_BINARY_DIR} /version .h ${SUPERTUX_SOURCES_C} ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_RESOURCES} src/main.cpp)
197
+ # TODO Is this even needed?
198
+ # $<$<BOOL:WIN32>:{CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc>
199
+ target_include_directories (supertux2 PUBLIC ${CMAKE_BINARY_DIR} src/)
207
200
208
- set_target_properties (supertux2_lib PROPERTIES OUTPUT_NAME supertux2_lib )
209
- set_target_properties (supertux2_lib PROPERTIES COMPILE_FLAGS "${SUPERTUX2_EXTRA_WARNING_FLAGS} " )
201
+ set_target_properties (supertux2 PROPERTIES OUTPUT_NAME "supertux2" )
202
+ set_target_properties (supertux2 PROPERTIES COMPILE_FLAGS "${SUPERTUX2_EXTRA_WARNING_FLAGS} " )
210
203
211
- if (WIN32 AND NOT VCPKG_BUILD)
212
- if (NOT MINGW)
204
+ # if(WIN32 AND NOT VCPKG_BUILD)
205
+ # if(NOT MINGW)
213
206
## Copy dlls on windows
214
- add_custom_command (TARGET supertux2_lib POST_BUILD
215
- COMMAND ${CMAKE_COMMAND} -E copy_directory
216
- "${DEPENDENCY_FOLDER} /dll"
217
- $<TARGET_FILE_DIR:supertux2_lib>)
218
- endif ()
219
- endif ()
207
+ # add_custom_command(TARGET supertux2_lib POST_BUILD
208
+ # COMMAND ${CMAKE_COMMAND} -E copy_directory
209
+ # "${DEPENDENCY_FOLDER}/dll"
210
+ # $<TARGET_FILE_DIR:supertux2_lib>)
211
+ # endif()
212
+ # endif()
220
213
221
214
## Some additional include paths
222
- target_include_directories (supertux2_lib SYSTEM PUBLIC
215
+ target_include_directories (supertux2 SYSTEM PUBLIC
223
216
external/findlocale/
224
217
external/obstack/
225
218
)
226
219
227
220
# Include altivec wrapper on ppc
228
221
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc.*" )
229
- target_include_directories (supertux2_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} /src/ppc)
222
+ target_include_directories (supertux2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} /src/ppc)
230
223
endif ()
231
224
232
225
## Link supertux binary with squirrel and other libraries
233
226
234
- target_link_libraries (supertux2_lib PUBLIC LibSimpleSquirrel)
235
- target_link_libraries (supertux2_lib PUBLIC LibTinygettext)
236
- target_link_libraries (supertux2_lib PUBLIC LibSexp)
237
- target_link_libraries (supertux2_lib PUBLIC LibSavePNG)
238
- target_link_libraries (supertux2_lib PUBLIC LibPartioZip)
239
- target_link_libraries (supertux2_lib PUBLIC OpenAL::OpenAL)
240
- target_link_libraries (supertux2_lib PUBLIC glm::glm)
241
- target_link_libraries (supertux2_lib PUBLIC fmt::fmt)
242
- target_link_libraries (supertux2_lib PUBLIC $<IF:$<TARGET_EXISTS:PhysFS::PhysFS>,PhysFS::PhysFS,PhysFS::PhysFS-static >)
227
+ target_link_libraries (supertux2 PUBLIC LibSimpleSquirrel)
228
+ target_link_libraries (supertux2 PUBLIC LibTinygettext)
229
+ target_link_libraries (supertux2 PUBLIC LibSexp)
230
+ target_link_libraries (supertux2 PUBLIC LibSavePNG)
231
+ target_link_libraries (supertux2 PUBLIC LibPartioZip)
232
+ target_link_libraries (supertux2 PUBLIC OpenAL::OpenAL)
233
+ target_link_libraries (supertux2 PUBLIC glm::glm)
234
+ target_compile_definitions (supertux2 PUBLIC GLM_ENABLE_EXPERIMENTAL)
235
+ target_link_libraries (supertux2 PUBLIC fmt::fmt)
236
+ target_link_libraries (supertux2 PUBLIC $<IF:$<TARGET_EXISTS:PhysFS::PhysFS>,PhysFS::PhysFS,PhysFS::PhysFS-static >)
243
237
244
238
if (NOT EMSCRIPTEN)
245
- target_link_libraries (supertux2_lib PUBLIC $<IF:$<TARGET_EXISTS:SDL2_ttf::SDL2_ttf>,SDL2_ttf::SDL2_ttf,SDL2_ttf::SDL2_ttf- static >)
246
- target_link_libraries (supertux2_lib PUBLIC
239
+ target_link_libraries (supertux2 PUBLIC
240
+ # SDL2_image
247
241
$<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static >
242
+ # SDL2_ttf
243
+ $<IF:$<TARGET_EXISTS:SDL2_ttf::SDL2_ttf>,SDL2_ttf::SDL2_ttf,SDL2_ttf::SDL2_ttf-static >
244
+ # SDL2 main (windows?)
248
245
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
246
+ # SDL2
249
247
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static >)
250
- target_link_libraries (supertux2_lib PUBLIC Ogg:ogg Vorbis::vorbis Vorbis::vorbisfile)
251
- target_link_libraries (supertux2_lib PUBLIC CURL::libcurl)
248
+ target_link_libraries (supertux2 PUBLIC Ogg: :ogg Vorbis::vorbis Vorbis::vorbisfile)
249
+ target_link_libraries (supertux2 PUBLIC CURL::libcurl)
252
250
endif ()
253
251
254
252
if (HAVE_OPENGL)
255
- target_link_libraries (supertux2_lib PUBLIC LibOpenGL)
253
+ target_link_libraries (supertux2 PUBLIC LibOpenGL)
256
254
endif ()
257
255
258
256
if (ENABLE_DISCORD)
259
- target_link_libraries (supertux2_lib PUBLIC LibDiscord)
257
+ target_link_libraries (supertux2 PUBLIC LibDiscord)
260
258
endif ()
261
259
262
260
## Install stuff
@@ -266,7 +264,8 @@ include(SuperTux/BuildInstall)
266
264
configure_file (config.h.cmake ${CMAKE_BINARY_DIR} /config.h )
267
265
268
266
## Build tests
269
- include (SuperTux/BuildTests)
267
+ # TODO Move to CMake Tests
268
+ #include(SuperTux/BuildTests)
270
269
271
270
## CPack/Installation-specific stuff
272
271
include (SuperTux/BuildCPack)
0 commit comments