Skip to content
Snippets Groups Projects
Commit 4599a06a authored by Stephen Hurd's avatar Stephen Hurd
Browse files

Use pkg-config for SDL2 explicitly

The implicit search was unreliable
parent 42c8f82e
Branches
No related tags found
No related merge requests found
......@@ -9,8 +9,11 @@ find_package(X11)
# ncurses.h
set(CURSES_NEED_WIDE TRUE)
find_package(Threads REQUIRED)
if(NOT WIN32)
find_package(Curses)
find_package(SDL2)
find_package(PkgConfig)
pkg_check_modules(SDL2 sdl2)
endif()
set(SOURCE
allfonts.c
......
......@@ -8,8 +8,8 @@ find_package(Threads)
find_package(X11)
if(NOT WIN32)
find_package(PkgConfig)
pkg_check_modules(SDL2 sdl2)
endif()
FIND_PACKAGE(SDL2)
set(SOURCE
conwrap.c
......@@ -80,7 +80,7 @@ if(NOT WIN32)
list(APPEND SOURCE xpsem.c)
endif()
if(SDL2_FOUND)
if(SDL2_INCLUDE_DIRS)
list(APPEND SOURCE sdlfuncs.c)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND SOURCE SDLMain.m)
......@@ -156,7 +156,7 @@ if(HAS_SRANDOMDEV_FUNC)
target_compile_definitions(xpdev PRIVATE HAS_SRANDOMDEV_FUNC)
endif()
if(SDL2_FOUND)
if(SDL2_INCLUDE_DIRS)
target_include_directories(xpdev PUBLIC ${SDL2_INCLUDE_DIRS})
set(WITH_SDL_AUDIO TRUE PARENT_SCOPE)
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment