summaryrefslogtreecommitdiff
path: root/CMake/Modules/FindSDL_gfx.cmake
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-02 01:48:38 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-02 02:41:24 +0200
commit3eeae12c498d1a4dbe969462d2ba841f77ee3ccb (patch)
treeff8eab35e732bc0749fc11677c8873a7b3a58704 /CMake/Modules/FindSDL_gfx.cmake
downloadplus-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.gz
plus-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.bz2
plus-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.xz
plus-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.zip
Initial commit.
This code based on mana client http://www.gitorious.org/mana/mana and my private repository.
Diffstat (limited to 'CMake/Modules/FindSDL_gfx.cmake')
-rw-r--r--CMake/Modules/FindSDL_gfx.cmake39
1 files changed, 39 insertions, 0 deletions
diff --git a/CMake/Modules/FindSDL_gfx.cmake b/CMake/Modules/FindSDL_gfx.cmake
new file mode 100644
index 000000000..74c1c6c74
--- /dev/null
+++ b/CMake/Modules/FindSDL_gfx.cmake
@@ -0,0 +1,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
+ PATH_SUFFIXES 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)