diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index a50ab39c7..49734c560 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -43,6 +43,13 @@ endif() # Include dir find_path(SDL2_INCLUDE_DIR + # We must search file which is present only in SDL2 and not in SDL1. + # Apparently when both SDL.h and SDL_scancode.h are specified, CMake is + # happy enough that it found SDL.h and doesn't bother about the other. + # + # On OSX, where the includes are not in SDL2/SDL.h form (which would solve + # this issue), but rather SDL2.framework/Headers/SDL.h, CMake might find + # SDL.framework/Headers/SDL.h if SDL1 is installed, which is wrong. NAMES SDL_scancode.h PATH_SUFFIXES ${PATH_SUFFIXES} )