From a6de8a58822a70182e58ead76a1b308e11350bff Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sat, 11 Feb 2012 17:08:51 +0100 Subject: FindSDL*: use FPHSA (#12467) --- Modules/FindSDL.cmake | 10 +++------- Modules/FindSDL_image.cmake | 7 +++---- Modules/FindSDL_mixer.cmake | 7 +++---- Modules/FindSDL_net.cmake | 7 +++---- Modules/FindSDL_sound.cmake | 6 +++--- Modules/FindSDL_ttf.cmake | 7 +++---- 6 files changed, 18 insertions(+), 26 deletions(-) diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 0dc02f5..1c04726 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -81,7 +81,6 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h /opt/csw # Blastwave /opt ) -#MESSAGE("SDL_INCLUDE_DIR is ${SDL_INCLUDE_DIR}") # SDL-1.1 is the name used by FreeBSD ports... # don't confuse it for the version number. @@ -97,8 +96,6 @@ FIND_LIBRARY(SDL_LIBRARY_TEMP /opt ) -#MESSAGE("SDL_LIBRARY_TEMP is ${SDL_LIBRARY_TEMP}") - IF(NOT SDL_BUILDING_LIBRARY) IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") # Non-OS X framework versions expect you to also dynamically link to @@ -134,7 +131,6 @@ IF(MINGW) SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") ENDIF(MINGW) -SET(SDL_FOUND "NO") IF(SDL_LIBRARY_TEMP) # For SDLmain IF(NOT SDL_BUILDING_LIBRARY) @@ -169,9 +165,9 @@ IF(SDL_LIBRARY_TEMP) SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") # Set the temp variable to INTERNAL so it is not seen in the CMake GUI SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "") - - SET(SDL_FOUND "YES") ENDIF(SDL_LIBRARY_TEMP) -#MESSAGE("SDL_LIBRARY is ${SDL_LIBRARY}") +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL + REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR) diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake index 5a5f59b..9a130fa 100644 --- a/Modules/FindSDL_image.cmake +++ b/Modules/FindSDL_image.cmake @@ -68,8 +68,7 @@ FIND_LIBRARY(SDLIMAGE_LIBRARY /opt ) -SET(SDLIMAGE_FOUND "NO") -IF(SDLIMAGE_LIBRARY AND SDLIMAGE_INCLUDE_DIR) - SET(SDLIMAGE_FOUND "YES") -ENDIF(SDLIMAGE_LIBRARY AND SDLIMAGE_INCLUDE_DIR) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE + REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR) diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake index e2b2294..ce1ae9e 100644 --- a/Modules/FindSDL_mixer.cmake +++ b/Modules/FindSDL_mixer.cmake @@ -68,8 +68,7 @@ FIND_LIBRARY(SDLMIXER_LIBRARY /opt ) -SET(SDLMIXER_FOUND "NO") -IF(SDLMIXER_LIBRARY AND SDLMIXER_INCLUDE_DIR) - SET(SDLMIXER_FOUND "YES") -ENDIF(SDLMIXER_LIBRARY AND SDLMIXER_INCLUDE_DIR) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER + REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR) diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake index 730b129..b5ada54 100644 --- a/Modules/FindSDL_net.cmake +++ b/Modules/FindSDL_net.cmake @@ -67,8 +67,7 @@ FIND_LIBRARY(SDLNET_LIBRARY /opt ) -SET(SDLNET_FOUND "NO") -IF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR) - SET(SDLNET_FOUND "YES") -ENDIF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET + REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR) diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 959f3eb..8edf6ca 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -114,7 +114,6 @@ FIND_LIBRARY(SDL_SOUND_LIBRARY /opt/lib ) -SET(SDL_SOUND_FOUND "NO") IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) # CMake is giving me problems using TRY_COMPILE with the CMAKE_FLAGS @@ -414,8 +413,9 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ENDIF(NOT MY_RESULT) SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries") - SET(SDL_SOUND_FOUND "YES") ENDIF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) - # MESSAGE("SDL_SOUND_LIBRARIES is ${SDL_SOUND_LIBRARIES}") +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND + REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR) diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake index b36ddd3..3d07ab7 100644 --- a/Modules/FindSDL_ttf.cmake +++ b/Modules/FindSDL_ttf.cmake @@ -68,8 +68,7 @@ FIND_LIBRARY(SDLTTF_LIBRARY PATH_SUFFIXES lib64 lib ) -SET(SDLTTF_FOUND "NO") -IF(SDLTTF_LIBRARY AND SDLTTF_INCLUDE_DIR) - SET(SDLTTF_FOUND "YES") -ENDIF(SDLTTF_LIBRARY AND SDLTTF_INCLUDE_DIR) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF + REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR) -- cgit v0.12