summaryrefslogtreecommitdiffhomepage
path: root/external
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-02 15:15:22 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-02 15:15:22 +0100
commitaccfa0d645c3bb0e846a854c38cec926d8c908e9 (patch)
tree37fbdd296a93e9411ca7b251f0a257c84c6d076d /external
parentcd8a1883be2bd0ca7101c700764704ba485d2072 (diff)
cmake: fix sdl2 linux build
Diffstat (limited to 'external')
-rw-r--r--external/CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 0012ec36..ad383f36 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -1,8 +1,15 @@
project(floormat-external)
+if(NOT DEFINED FLOORMAT_SUBMODULE-SDL2)
+ find_package(SDL2 QUIET)
+ if(SDL2_FOUND)
+ set(FLOORMAT_SUBMODULE-SDL2 OFF CACHE BOOL "SDL2 as submodule")
+ endif()
+endif()
+
+set(FLOORMAT_SUBMODULE-SDL2 ON CACHE BOOL "SDL2 as submodule")
set(FLOORMAT_SUBMODULE-DEPENDENCIES ON CACHE BOOL
"Use dependencies included in the source directory (needs git submodule update --init).")
-set(FLOORMAT_SUBMODULE-SDL2 ON CACHE BOOL "SDL2 as submodule")
foreach(_module corrade magnum magnum-integration magnum-plugins)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${_module}/modules")
@@ -141,6 +148,7 @@ if(FLOORMAT_SUBMODULE-DEPENDENCIES)
MAGNUM_WITH_GLM OFF
MAGNUM_WITH_IMGUI ON
)
+ if(WIN32)
sets(BOOL
SDL2_DISABLE_INSTALL OFF
SDL2_DISABLE_SDL2MAIN ON
@@ -186,6 +194,7 @@ if(FLOORMAT_SUBMODULE-DEPENDENCIES)
SDL_WASAPI OFF
SDL_XINPUT OFF
)
+ endif(WIN32)
if(WIN32)
sets(BOOL MAGNUM_WITH_WINDOWLESSWGLAPPLICATION ON)
elseif(APPLE)