Skip to content

Instantly share code, notes, and snippets.

@glebm
Created February 15, 2020 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glebm/827c7944edd24755dc9cb216521df32f to your computer and use it in GitHub Desktop.
Save glebm/827c7944edd24755dc9cb216521df32f to your computer and use it in GitHub Desktop.
FindSDL_gfx.cmake
# Tries to find SDL_gfx (for SDL1)
# Once done, this will define:
# > SDL_GFX_FOUND - The system has libnx
# > SDL_GFX_INCLUDE_DIRS - The libnx include directories
# > SDL_GFX_LIBRARIES - The libnx libraries required for using it
find_path(SDL_GFX_INCLUDE_DIR SDL_gfxPrimitives.h
HINTS
$ENV{SDL_GFX_DIR}
$ENV{SDLDIR}
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/SDL
/usr/include/SDL
/usr/local/include/SDL12
/usr/include/SDL12
/usr/local/include
/usr/include
/sw/include/SDL # Fink
/sw/include
/opt/local/include/SDL # DarwinPorts
/opt/local/include
/opt/csw/include/SDL # Blastwave
/opt/csw/include
/opt/include/SDL
/opt/include
)
find_library(SDL_GFX_LIBRARY
NAMES SDL_gfx
HINTS
$ENV{SDL_GFX_DIR}
$ENV{SDLDIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
# Handle the QUIETLY and REQUIRED arguments and set SDL_GFX_FOUND to TRUE if all above variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SDL_GFX DEFAULT_MSG
SDL_GFX_INCLUDE_DIR SDL_GFX_LIBRARY)
set(SDL_GFX_INCLUDE_DIRS ${SDL_GFX_INCLUDE_DIR})
set(SDL_GFX_LIBRARIES ${SDL_GFX_LIBRARY})
mark_as_advanced(SDL_GFX_INCLUDE_DIR SDL_GFX_LIBRARY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment