Browse Source

🔨 CMake: Better error message for bad SDL2 configs

pull/1709/head
Gleb Mazovetskiy 5 years ago
parent
commit
eb4fbdc302
  1. 4
      CMakeLists.txt

4
CMakeLists.txt

@ -203,11 +203,13 @@ else()
find_package(SDL2 REQUIRED)
if(TARGET SDL2::SDL2)
set(SDL2_TARGET SDL2::SDL2)
else()
elseif(TARGET SDL2::SDL2-static)
# On some distros, such as vitasdk, only the SDL2::SDL2-static target is available.
set(SDL2_TARGET SDL2::SDL2-static)
# Alias to SDL2::SDL2 because some finder scripts may refer to SDL2::SDL2.
add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
else()
message(FATAL_ERROR "SDL2 cmake config found but it does not define SDL2::SDL2 nor SDL2::SDL2-static")
endif()
find_package(SDL2_ttf REQUIRED)
find_package(SDL2_mixer REQUIRED)

Loading…
Cancel
Save