summaryrefslogtreecommitdiff
path: root/CMake/Modules/FindSDL_gfx.cmake
blob: 092f884d19bba63d0bfc4afafd6fc8e201c2a200 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# - Try to find SDL_gfx
# Once done this will define
#
#  SDLGFX_FOUND - system has SDL_gfx
#  SDLGFX_INCLUDE_DIR - the SDL_gfx include directory

# Be quiet if SDL_gfx was already found
IF (SDL_gfx_INCLUDE_DIR AND SDL_gfx_LIBRARY)
    SET(SDL_gfx_QUIET TRUE)
ENDIF (SDL_gfx_INCLUDE_DIR AND SDL_gfx_LIBRARY)


FIND_PATH(SDL_gfx_INCLUDE_DIR
    NAMES SDL_rotozoom.h
    PATHS /usr/include/SDL /usr/local/include/SDL
    )

FIND_LIBRARY(SDL_gfx_LIBRARY
    NAMES SDL_gfx
    PATHS /usr/lib /usr/local/lib
    )

MARK_AS_ADVANCED(SDL_gfx_INCLUDE_DIR SDL_gfx_LIBRARY)


IF (SDL_gfx_INCLUDE_DIR AND SDL_gfx_LIBRARY)
    SET(SDLGFX_FOUND TRUE)
    SET(SDLGFX_INCLUDE_DIR ${SDL_gfx_INCLUDE_DIR})
    SET(SDLGFX_LIBRARIES ${SDL_gfx_LIBRARY})

    IF (NOT SDL_gfx_FIND_QUIETLY AND NOT SDL_gfx_QUIET)
        MESSAGE(STATUS "Found SDL_gfx: ${SDL_gfx_LIBRARY}")
    ENDIF (NOT SDL_gfx_FIND_QUIETLY AND NOT SDL_gfx_QUIET)
ENDIF (SDL_gfx_INCLUDE_DIR AND SDL_gfx_LIBRARY)

# Bail out if SDL_gfx is not found but required
IF (NOT SDLGFX_FOUND AND SDL_gfx_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could NOT find SDL_gfx library ${SDLGFX_INCLUDE_DIR}")
ENDIF (NOT SDLGFX_FOUND AND SDL_gfx_FIND_REQUIRED)