Commit 198864c1 authored by Florian Oetke's avatar Florian Oetke
Browse files

added find_path to work-around broken SDL2 find scripts

parent 911cc554
......@@ -39,11 +39,19 @@ if(MIRRAGE_PREFER_SYSTEM_SDL)
add_library(mirrage::deps::SDL2main ALIAS SDL2::SDL2main)
else()
if(NOT EXISTS ${SDL2_INCLUDE_DIR}/SDL.h)
set(SDL2_INCLUDE_DIR ${SDL2_INCLUDE_DIR}/SDL2)
if(EXISTS ${SDL2_INCLUDE_DIR}/SDL2/SDL.h)
set(SDL2_INCLUDE_DIR "${SDL2_INCLUDE_DIR}/SDL2")
else()
find_path(SDL2_INCLUDE_DIR NAMES SDL_vulkan.h PATH_SUFFIXES SDL2)
message("Found SDL2 include directory: ${SDL2_INCLUDE_DIR}")
endif()
endif()
if(EXISTS ${SDL2_INCLUDE_DIR}/SDL.h)
add_library(mirrage::deps::SDL2 INTERFACE IMPORTED GLOBAL)
set_property(TARGET mirrage::deps::SDL2 PROPERTY INTERFACE_LINK_LIBRARIES ${SDL2_LIBRARY})
set_property(TARGET mirrage::deps::SDL2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR})
endif()
add_library(mirrage::deps::SDL2 INTERFACE IMPORTED GLOBAL)
set_property(TARGET mirrage::deps::SDL2 PROPERTY INTERFACE_LINK_LIBRARIES ${SDL2_LIBRARY})
set_property(TARGET mirrage::deps::SDL2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR})
endif()
endif()
endif()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment