diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index dc782e252..44ed4196d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -151,15 +151,16 @@ if (ENABLE_SDL2) | |||
| 151 | set(SDL2_INCLUDE_DIR "${SDL2_PREFIX}/include" CACHE PATH "Path to SDL2 headers") | 151 | set(SDL2_INCLUDE_DIR "${SDL2_PREFIX}/include" CACHE PATH "Path to SDL2 headers") |
| 152 | set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library") | 152 | set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library") |
| 153 | set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll") | 153 | set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll") |
| 154 | else() | ||
| 155 | find_package(SDL2 REQUIRED) | ||
| 156 | endif() | ||
| 157 | 154 | ||
| 158 | if (SDL2_FOUND) | ||
| 159 | # TODO(yuriks): Make FindSDL2.cmake export an IMPORTED library instead | ||
| 160 | add_library(SDL2 INTERFACE) | 155 | add_library(SDL2 INTERFACE) |
| 161 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") | 156 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") |
| 162 | target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") | 157 | target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") |
| 158 | else() | ||
| 159 | find_package(SDL2 REQUIRED) | ||
| 160 | include_directories(${SDL2_INCLUDE_DIRS}) | ||
| 161 | |||
| 162 | add_library(SDL2 INTERFACE) | ||
| 163 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") | ||
| 163 | endif() | 164 | endif() |
| 164 | else() | 165 | else() |
| 165 | set(SDL2_FOUND NO) | 166 | set(SDL2_FOUND NO) |