Merge topic 'ImproveFindSDLxxxModules'
68c6b13
FindSDL: Stay compatible with old input variables9ed24c5
FindSDL: Remove from find_... calls PATHS that are set by default38a0f71
FindSDL: Add my copyright tag to all FindSDL_* modules020d213
FindSDL: Add version support61a566c
FindSDL: Format documentation22154c7
FindSDL: Update documentation4541c07
FindSDL: Add version support for FindSDL_ttfa28c247
FindSDL: Use SDL_TTF prefix for variables9f5dbf4
FindSDL: Update documentationd83f80d
FindSDL: Add version support for FindSDL_mixerc10b691
FindSDL: Use SDL_MIXER prefix for variables03dd6cc
FindSDL: Pass SDL_SOUND_LIBRARY to FIND_PACKAGE_HANDLE_STANDARD_ARGS326beca
FindSDL: Use same capitalization for FPHSA as file namecfe5b87
FindSDL: Version support for FindSDL_sound776d3fe
FindSDL: Format the documentationa5194e2
FindSDL: Add "cmake_minimum_required" to "try_compile" project ...
This commit is contained in:
commit
7d03885d21
|
@ -1,8 +1,9 @@
|
||||||
# Locate SDL library
|
# - Locate SDL library
|
||||||
# This module defines
|
# This module defines
|
||||||
# SDL_LIBRARY, the name of the library to link against
|
# SDL_LIBRARY, the name of the library to link against
|
||||||
# SDL_FOUND, if false, do not try to link to SDL
|
# SDL_FOUND, if false, do not try to link to SDL
|
||||||
# SDL_INCLUDE_DIR, where to find SDL.h
|
# SDL_INCLUDE_DIR, where to find SDL.h
|
||||||
|
# SDL_VERSION_STRING, human-readable string containing the version of SDL
|
||||||
#
|
#
|
||||||
# This module responds to the the flag:
|
# This module responds to the the flag:
|
||||||
# SDL_BUILDING_LIBRARY
|
# SDL_BUILDING_LIBRARY
|
||||||
|
@ -54,6 +55,7 @@
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2003-2009 Kitware, Inc.
|
# Copyright 2003-2009 Kitware, Inc.
|
||||||
|
# Copyright 2012 Benjamin Eikel
|
||||||
#
|
#
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
# see accompanying file Copyright.txt for details.
|
# see accompanying file Copyright.txt for details.
|
||||||
|
@ -68,18 +70,7 @@
|
||||||
find_path(SDL_INCLUDE_DIR SDL.h
|
find_path(SDL_INCLUDE_DIR SDL.h
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES include/SDL include
|
PATH_SUFFIXES SDL SDL12 SDL11
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/include/SDL12
|
|
||||||
/usr/local/include/SDL11 # FreeBSD ports
|
|
||||||
/usr/include/SDL12
|
|
||||||
/usr/include/SDL11
|
|
||||||
/sw # Fink
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt/csw # Blastwave
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# SDL-1.1 is the name used by FreeBSD ports...
|
# SDL-1.1 is the name used by FreeBSD ports...
|
||||||
|
@ -88,12 +79,6 @@ find_library(SDL_LIBRARY_TEMP
|
||||||
NAMES SDL SDL-1.1
|
NAMES SDL SDL-1.1
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES lib
|
|
||||||
PATHS
|
|
||||||
/sw
|
|
||||||
/opt/local
|
|
||||||
/opt/csw
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT SDL_BUILDING_LIBRARY)
|
if(NOT SDL_BUILDING_LIBRARY)
|
||||||
|
@ -169,7 +154,24 @@ if(SDL_LIBRARY_TEMP)
|
||||||
set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
|
set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h")
|
||||||
|
file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MAJOR "${SDL_VERSION_MAJOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MINOR "${SDL_VERSION_MINOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_VERSION_PATCH "${SDL_VERSION_PATCH_LINE}")
|
||||||
|
set(SDL_VERSION_STRING ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH})
|
||||||
|
unset(SDL_VERSION_MAJOR_LINE)
|
||||||
|
unset(SDL_VERSION_MINOR_LINE)
|
||||||
|
unset(SDL_VERSION_PATCH_LINE)
|
||||||
|
unset(SDL_VERSION_MAJOR)
|
||||||
|
unset(SDL_VERSION_MINOR)
|
||||||
|
unset(SDL_VERSION_PATCH)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
|
||||||
REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR)
|
REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR
|
||||||
|
VERSION_VAR SDL_VERSION_STRING)
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
# Locate SDL_image library
|
# - Locate SDL_image library
|
||||||
# This module defines
|
# This module defines:
|
||||||
# SDLIMAGE_LIBRARY, the name of the library to link against
|
# SDL_IMAGE_LIBRARIES, the name of the library to link against
|
||||||
# SDLIMAGE_FOUND, if false, do not try to link to SDL
|
# SDL_IMAGE_INCLUDE_DIRS, where to find the headers
|
||||||
# SDLIMAGE_INCLUDE_DIR, where to find SDL/SDL.h
|
# SDL_IMAGE_FOUND, if false, do not try to link against
|
||||||
|
# SDL_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image
|
||||||
|
#
|
||||||
|
# For backward compatiblity the following variables are also set:
|
||||||
|
# SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
|
||||||
|
# SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
|
||||||
|
# SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
|
||||||
#
|
#
|
||||||
# $SDLDIR is an environment variable that would
|
# $SDLDIR is an environment variable that would
|
||||||
# correspond to the ./configure --prefix=$SDLDIR
|
# correspond to the ./configure --prefix=$SDLDIR
|
||||||
|
@ -14,6 +20,7 @@
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2005-2009 Kitware, Inc.
|
# Copyright 2005-2009 Kitware, Inc.
|
||||||
|
# Copyright 2012 Benjamin Eikel
|
||||||
#
|
#
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
# see accompanying file Copyright.txt for details.
|
# see accompanying file Copyright.txt for details.
|
||||||
|
@ -25,40 +32,56 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
find_path(SDLIMAGE_INCLUDE_DIR SDL_image.h
|
if(NOT SDL_IMAGE_INCLUDE_DIR AND SDLIMAGE_INCLUDE_DIR)
|
||||||
|
set(SDL_IMAGE_INCLUDE_DIR ${SDLIMAGE_INCLUDE_DIR} CACHE PATH "directory cache
|
||||||
|
entry initialized from old variable name")
|
||||||
|
endif()
|
||||||
|
find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLIMAGEDIR
|
ENV SDLIMAGEDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES include include/SDL
|
PATH_SUFFIXES SDL SDL12 SDL11
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/include/SDL12
|
|
||||||
/usr/local/include/SDL11 # FreeBSD ports
|
|
||||||
/usr/include/SDL12
|
|
||||||
/usr/include/SDL11
|
|
||||||
/sw # Fink
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt/csw # Blastwave
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(SDLIMAGE_LIBRARY
|
if(NOT SDL_IMAGE_LIBRARY AND SDLIMAGE_LIBRARY)
|
||||||
|
set(SDL_IMAGE_LIBRARY ${SDLIMAGE_LIBRARY} CACHE FILEPATH "file cache entry
|
||||||
|
initialized from old variable name")
|
||||||
|
endif()
|
||||||
|
find_library(SDL_IMAGE_LIBRARY
|
||||||
NAMES SDL_image
|
NAMES SDL_image
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLIMAGEDIR
|
ENV SDLIMAGEDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES lib
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/sw
|
|
||||||
/opt/local
|
|
||||||
/opt/csw
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(SDL_IMAGE_INCLUDE_DIR AND EXISTS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h")
|
||||||
|
file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+[0-9]+$")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_MAJOR "${SDL_IMAGE_VERSION_MAJOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_MINOR "${SDL_IMAGE_VERSION_MINOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_PATCH "${SDL_IMAGE_VERSION_PATCH_LINE}")
|
||||||
|
set(SDL_IMAGE_VERSION_STRING ${SDL_IMAGE_VERSION_MAJOR}.${SDL_IMAGE_VERSION_MINOR}.${SDL_IMAGE_VERSION_PATCH})
|
||||||
|
unset(SDL_IMAGE_VERSION_MAJOR_LINE)
|
||||||
|
unset(SDL_IMAGE_VERSION_MINOR_LINE)
|
||||||
|
unset(SDL_IMAGE_VERSION_PATCH_LINE)
|
||||||
|
unset(SDL_IMAGE_VERSION_MAJOR)
|
||||||
|
unset(SDL_IMAGE_VERSION_MINOR)
|
||||||
|
unset(SDL_IMAGE_VERSION_PATCH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SDL_IMAGE_LIBRARIES ${SDL_IMAGE_LIBRARY})
|
||||||
|
set(SDL_IMAGE_INCLUDE_DIRS ${SDL_IMAGE_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_image
|
||||||
REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR)
|
REQUIRED_VARS SDL_IMAGE_LIBRARIES SDL_IMAGE_INCLUDE_DIRS
|
||||||
|
VERSION_VAR SDL_IMAGE_VERSION_STRING)
|
||||||
|
|
||||||
|
# for backward compatiblity
|
||||||
|
set(SDLIMAGE_LIBRARY ${SDL_IMAGE_LIBRARIES})
|
||||||
|
set(SDLIMAGE_INCLUDE_DIR ${SDL_IMAGE_INCLUDE_DIRS})
|
||||||
|
set(SDLIMAGE_FOUND ${SDL_IMAGE_FOUND})
|
||||||
|
|
||||||
|
mark_as_advanced(SDL_IMAGE_LIBRARY SDL_IMAGE_INCLUDE_DIR)
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
# Locate SDL_mixer library
|
# - Locate SDL_mixer library
|
||||||
# This module defines
|
# This module defines:
|
||||||
# SDLMIXER_LIBRARY, the name of the library to link against
|
# SDL_MIXER_LIBRARIES, the name of the library to link against
|
||||||
# SDLMIXER_FOUND, if false, do not try to link to SDL
|
# SDL_MIXER_INCLUDE_DIRS, where to find the headers
|
||||||
# SDLMIXER_INCLUDE_DIR, where to find SDL/SDL.h
|
# SDL_MIXER_FOUND, if false, do not try to link against
|
||||||
|
# SDL_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer
|
||||||
|
#
|
||||||
|
# For backward compatiblity the following variables are also set:
|
||||||
|
# SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
|
||||||
|
# SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
|
||||||
|
# SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
|
||||||
#
|
#
|
||||||
# $SDLDIR is an environment variable that would
|
# $SDLDIR is an environment variable that would
|
||||||
# correspond to the ./configure --prefix=$SDLDIR
|
# correspond to the ./configure --prefix=$SDLDIR
|
||||||
|
@ -14,6 +20,7 @@
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2005-2009 Kitware, Inc.
|
# Copyright 2005-2009 Kitware, Inc.
|
||||||
|
# Copyright 2012 Benjamin Eikel
|
||||||
#
|
#
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
# see accompanying file Copyright.txt for details.
|
# see accompanying file Copyright.txt for details.
|
||||||
|
@ -25,40 +32,56 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
find_path(SDLMIXER_INCLUDE_DIR SDL_mixer.h
|
if(NOT SDL_MIXER_INCLUDE_DIR AND SDLMIXER_INCLUDE_DIR)
|
||||||
|
set(SDL_MIXER_INCLUDE_DIR ${SDLMIXER_INCLUDE_DIR} CACHE PATH "directory cache
|
||||||
|
entry initialized from old variable name")
|
||||||
|
endif()
|
||||||
|
find_path(SDL_MIXER_INCLUDE_DIR SDL_mixer.h
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLMIXERDIR
|
ENV SDLMIXERDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES include include/SDL
|
PATH_SUFFIXES SDL SDL12 SDL11
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/include/SDL12
|
|
||||||
/usr/local/include/SDL11 # FreeBSD ports
|
|
||||||
/usr/include/SDL12
|
|
||||||
/usr/include/SDL11
|
|
||||||
/sw # Fink
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt/csw # Blastwave
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(SDLMIXER_LIBRARY
|
if(NOT SDL_MIXER_LIBRARY AND SDLMIXER_LIBRARY)
|
||||||
|
set(SDL_MIXER_LIBRARY ${SDLMIXER_LIBRARY} CACHE FILEPATH "file cache entry
|
||||||
|
initialized from old variable name")
|
||||||
|
endif()
|
||||||
|
find_library(SDL_MIXER_LIBRARY
|
||||||
NAMES SDL_mixer
|
NAMES SDL_mixer
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLMIXERDIR
|
ENV SDLMIXERDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES lib
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/sw
|
|
||||||
/opt/local
|
|
||||||
/opt/csw
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(SDL_MIXER_INCLUDE_DIR AND EXISTS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h")
|
||||||
|
file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+[0-9]+$")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_MAJOR "${SDL_MIXER_VERSION_MAJOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_MINOR "${SDL_MIXER_VERSION_MINOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_PATCH "${SDL_MIXER_VERSION_PATCH_LINE}")
|
||||||
|
set(SDL_MIXER_VERSION_STRING ${SDL_MIXER_VERSION_MAJOR}.${SDL_MIXER_VERSION_MINOR}.${SDL_MIXER_VERSION_PATCH})
|
||||||
|
unset(SDL_MIXER_VERSION_MAJOR_LINE)
|
||||||
|
unset(SDL_MIXER_VERSION_MINOR_LINE)
|
||||||
|
unset(SDL_MIXER_VERSION_PATCH_LINE)
|
||||||
|
unset(SDL_MIXER_VERSION_MAJOR)
|
||||||
|
unset(SDL_MIXER_VERSION_MINOR)
|
||||||
|
unset(SDL_MIXER_VERSION_PATCH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SDL_MIXER_LIBRARIES ${SDL_MIXER_LIBRARY})
|
||||||
|
set(SDL_MIXER_INCLUDE_DIRS ${SDL_MIXER_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_mixer
|
||||||
REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR)
|
REQUIRED_VARS SDL_MIXER_LIBRARIES SDL_MIXER_INCLUDE_DIRS
|
||||||
|
VERSION_VAR SDL_MIXER_VERSION_STRING)
|
||||||
|
|
||||||
|
# for backward compatiblity
|
||||||
|
set(SDLMIXER_LIBRARY ${SDL_MIXER_LIBRARIES})
|
||||||
|
set(SDLMIXER_INCLUDE_DIR ${SDL_MIXER_INCLUDE_DIRS})
|
||||||
|
set(SDLMIXER_FOUND ${SDL_MIXER_FOUND})
|
||||||
|
|
||||||
|
mark_as_advanced(SDL_MIXER_LIBRARY SDL_MIXER_INCLUDE_DIR)
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
# Locate SDL_net library
|
# - Locate SDL_net library
|
||||||
# This module defines
|
# This module defines:
|
||||||
# SDLNET_LIBRARY, the name of the library to link against
|
# SDL_NET_LIBRARIES, the name of the library to link against
|
||||||
# SDLNET_FOUND, if false, do not try to link against
|
# SDL_NET_INCLUDE_DIRS, where to find the headers
|
||||||
# SDLNET_INCLUDE_DIR, where to find the headers
|
# SDL_NET_FOUND, if false, do not try to link against
|
||||||
|
# SDL_NET_VERSION_STRING - human-readable string containing the version of SDL_net
|
||||||
|
#
|
||||||
|
# For backward compatiblity the following variables are also set:
|
||||||
|
# SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
|
||||||
|
# SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
|
||||||
|
# SDLNET_FOUND (same value as SDL_NET_FOUND)
|
||||||
#
|
#
|
||||||
# $SDLDIR is an environment variable that would
|
# $SDLDIR is an environment variable that would
|
||||||
# correspond to the ./configure --prefix=$SDLDIR
|
# correspond to the ./configure --prefix=$SDLDIR
|
||||||
|
@ -14,6 +20,7 @@
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2005-2009 Kitware, Inc.
|
# Copyright 2005-2009 Kitware, Inc.
|
||||||
|
# Copyright 2012 Benjamin Eikel
|
||||||
#
|
#
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
# see accompanying file Copyright.txt for details.
|
# see accompanying file Copyright.txt for details.
|
||||||
|
@ -25,39 +32,56 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
find_path(SDLNET_INCLUDE_DIR SDL_net.h
|
if(NOT SDL_NET_INCLUDE_DIR AND SDLNET_INCLUDE_DIR)
|
||||||
|
set(SDL_NET_INCLUDE_DIR ${SDLNET_INCLUDE_DIR} CACHE PATH "directory cache
|
||||||
|
entry initialized from old variable name")
|
||||||
|
endif()
|
||||||
|
find_path(SDL_NET_INCLUDE_DIR SDL_net.h
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLNETDIR
|
ENV SDLNETDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES include include/SDL
|
PATH_SUFFIXES SDL SDL12 SDL11
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/include/SDL12
|
|
||||||
/usr/local/include/SDL11 # FreeBSD ports
|
|
||||||
/usr/include/SDL12
|
|
||||||
/usr/include/SDL11
|
|
||||||
/sw # Fink
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt/csw # Blastwave
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
find_library(SDLNET_LIBRARY
|
|
||||||
|
if(NOT SDL_NET_LIBRARY AND SDLNET_LIBRARY)
|
||||||
|
set(SDL_NET_LIBRARY ${SDLNET_LIBRARY} CACHE FILEPATH "file cache entry
|
||||||
|
initialized from old variable name")
|
||||||
|
endif()
|
||||||
|
find_library(SDL_NET_LIBRARY
|
||||||
NAMES SDL_net
|
NAMES SDL_net
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLNETDIR
|
ENV SDLNETDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES lib
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/sw
|
|
||||||
/opt/local
|
|
||||||
/opt/csw
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(SDL_NET_INCLUDE_DIR AND EXISTS "${SDL_NET_INCLUDE_DIR}/SDL_net.h")
|
||||||
|
file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+[0-9]+$")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_MAJOR "${SDL_NET_VERSION_MAJOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_MINOR "${SDL_NET_VERSION_MINOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_PATCH "${SDL_NET_VERSION_PATCH_LINE}")
|
||||||
|
set(SDL_NET_VERSION_STRING ${SDL_NET_VERSION_MAJOR}.${SDL_NET_VERSION_MINOR}.${SDL_NET_VERSION_PATCH})
|
||||||
|
unset(SDL_NET_VERSION_MAJOR_LINE)
|
||||||
|
unset(SDL_NET_VERSION_MINOR_LINE)
|
||||||
|
unset(SDL_NET_VERSION_PATCH_LINE)
|
||||||
|
unset(SDL_NET_VERSION_MAJOR)
|
||||||
|
unset(SDL_NET_VERSION_MINOR)
|
||||||
|
unset(SDL_NET_VERSION_PATCH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SDL_NET_LIBRARIES ${SDL_NET_LIBRARY})
|
||||||
|
set(SDL_NET_INCLUDE_DIRS ${SDL_NET_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_net
|
||||||
REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR)
|
REQUIRED_VARS SDL_NET_LIBRARIES SDL_NET_INCLUDE_DIRS
|
||||||
|
VERSION_VAR SDL_NET_VERSION_STRING)
|
||||||
|
|
||||||
|
# for backward compatiblity
|
||||||
|
set(SDLNET_LIBRARY ${SDL_NET_LIBRARIES})
|
||||||
|
set(SDLNET_INCLUDE_DIR ${SDL_NET_INCLUDE_DIRS})
|
||||||
|
set(SDLNET_FOUND ${SDL_NET_FOUND})
|
||||||
|
|
||||||
|
mark_as_advanced(SDL_NET_LIBRARY SDL_NET_INCLUDE_DIR)
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
# Locates the SDL_sound library
|
# - Locates the SDL_sound library
|
||||||
|
#
|
||||||
# This module depends on SDL being found and
|
# This module depends on SDL being found and
|
||||||
# must be called AFTER FindSDL.cmake is called.
|
# must be called AFTER FindSDL.cmake is called.
|
||||||
|
#
|
||||||
# This module defines
|
# This module defines
|
||||||
# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
|
# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
|
||||||
# SDL_SOUND_FOUND, if false, do not try to link to SDL
|
# SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
|
||||||
# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
|
# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
|
||||||
# to link against. This is a read-only variable and is marked INTERNAL.
|
# to link against. This is a read-only variable and is marked INTERNAL.
|
||||||
# SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
|
# SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
|
||||||
# flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
|
# flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
|
||||||
# This is available mostly for cases this module failed to anticipate for
|
# This is available mostly for cases this module failed to anticipate for
|
||||||
# and you must add additional flags. This is marked as ADVANCED.
|
# and you must add additional flags. This is marked as ADVANCED.
|
||||||
|
# SDL_SOUND_VERSION_STRING, human-readable string containing the version of SDL_sound
|
||||||
#
|
#
|
||||||
# This module also defines (but you shouldn't need to use directly)
|
# This module also defines (but you shouldn't need to use directly)
|
||||||
# SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
|
# SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
|
||||||
|
@ -54,10 +54,10 @@
|
||||||
# People will have to manually change the cache values of
|
# People will have to manually change the cache values of
|
||||||
# SDL_LIBRARY to override this selectionor set the CMake environment
|
# SDL_LIBRARY to override this selectionor set the CMake environment
|
||||||
# CMAKE_INCLUDE_PATH to modify the search paths.
|
# CMAKE_INCLUDE_PATH to modify the search paths.
|
||||||
#
|
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2005-2009 Kitware, Inc.
|
# Copyright 2005-2009 Kitware, Inc.
|
||||||
|
# Copyright 2012 Benjamin Eikel
|
||||||
#
|
#
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
# see accompanying file Copyright.txt for details.
|
# see accompanying file Copyright.txt for details.
|
||||||
|
@ -77,17 +77,7 @@ find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLSOUNDDIR
|
ENV SDLSOUNDDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES SDL SDL12 SDL11
|
||||||
include include/SDL
|
|
||||||
PATHS
|
|
||||||
/usr/local/include/SDL12
|
|
||||||
/usr/local/include/SDL11 # FreeBSD ports
|
|
||||||
/usr/include/SDL12
|
|
||||||
/usr/include/SDL11
|
|
||||||
/sw # Fink
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt/csw # Blastwave
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(SDL_SOUND_LIBRARY
|
find_library(SDL_SOUND_LIBRARY
|
||||||
|
@ -95,13 +85,6 @@ find_library(SDL_SOUND_LIBRARY
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLSOUNDDIR
|
ENV SDLSOUNDDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES
|
|
||||||
lib
|
|
||||||
PATHS
|
|
||||||
/sw
|
|
||||||
/opt/local
|
|
||||||
/opt/csw
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
|
if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
|
||||||
|
@ -176,7 +159,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
|
||||||
# in the SDL_LIBRARY string after the "-framework".
|
# in the SDL_LIBRARY string after the "-framework".
|
||||||
# But if I quote the stuff in INCLUDE_DIRECTORIES, it doesn't work.
|
# But if I quote the stuff in INCLUDE_DIRECTORIES, it doesn't work.
|
||||||
file(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
|
file(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
|
||||||
"project(DetermineSoundLibs)
|
"cmake_minimum_required(VERSION 2.8)
|
||||||
|
project(DetermineSoundLibs)
|
||||||
include_directories(${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
|
include_directories(${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
|
||||||
add_executable(DetermineSoundLibs DetermineSoundLibs.c)
|
add_executable(DetermineSoundLibs DetermineSoundLibs.c)
|
||||||
target_link_libraries(DetermineSoundLibs ${TMP_TRY_LIBS})"
|
target_link_libraries(DetermineSoundLibs ${TMP_TRY_LIBS})"
|
||||||
|
@ -376,7 +360,24 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
|
||||||
set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
|
set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(SDL_SOUND_INCLUDE_DIR AND EXISTS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h")
|
||||||
|
file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SOUND_VER_MAJOR[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_MINOR_LINE REGEX "^#define[ \t]+SOUND_VER_MINOR[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_PATCH_LINE REGEX "^#define[ \t]+SOUND_VER_PATCH[ \t]+[0-9]+$")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SOUND_VER_MAJOR[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_MAJOR "${SDL_SOUND_VERSION_MAJOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SOUND_VER_MINOR[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_MINOR "${SDL_SOUND_VERSION_MINOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SOUND_VER_PATCH[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_PATCH "${SDL_SOUND_VERSION_PATCH_LINE}")
|
||||||
|
set(SDL_SOUND_VERSION_STRING ${SDL_SOUND_VERSION_MAJOR}.${SDL_SOUND_VERSION_MINOR}.${SDL_SOUND_VERSION_PATCH})
|
||||||
|
unset(SDL_SOUND_VERSION_MAJOR_LINE)
|
||||||
|
unset(SDL_SOUND_VERSION_MINOR_LINE)
|
||||||
|
unset(SDL_SOUND_VERSION_PATCH_LINE)
|
||||||
|
unset(SDL_SOUND_VERSION_MAJOR)
|
||||||
|
unset(SDL_SOUND_VERSION_MINOR)
|
||||||
|
unset(SDL_SOUND_VERSION_PATCH)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_sound
|
||||||
REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR)
|
REQUIRED_VARS SDL_SOUND_LIBRARY SDL_SOUND_INCLUDE_DIR
|
||||||
|
VERSION_VAR SDL_SOUND_VERSION_STRING)
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
# Locate SDL_ttf library
|
# - Locate SDL_ttf library
|
||||||
# This module defines
|
# This module defines:
|
||||||
# SDLTTF_LIBRARY, the name of the library to link against
|
# SDL_TTF_LIBRARIES, the name of the library to link against
|
||||||
# SDLTTF_FOUND, if false, do not try to link to SDL
|
# SDL_TTF_INCLUDE_DIRS, where to find the headers
|
||||||
# SDLTTF_INCLUDE_DIR, where to find SDL/SDL.h
|
# SDL_TTF_FOUND, if false, do not try to link against
|
||||||
|
# SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
|
||||||
|
#
|
||||||
|
# For backward compatiblity the following variables are also set:
|
||||||
|
# SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
|
||||||
|
# SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
|
||||||
|
# SDLTTF_FOUND (same value as SDL_TTF_FOUND)
|
||||||
#
|
#
|
||||||
# $SDLDIR is an environment variable that would
|
# $SDLDIR is an environment variable that would
|
||||||
# correspond to the ./configure --prefix=$SDLDIR
|
# correspond to the ./configure --prefix=$SDLDIR
|
||||||
|
@ -14,6 +20,7 @@
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2005-2009 Kitware, Inc.
|
# Copyright 2005-2009 Kitware, Inc.
|
||||||
|
# Copyright 2012 Benjamin Eikel
|
||||||
#
|
#
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
# see accompanying file Copyright.txt for details.
|
# see accompanying file Copyright.txt for details.
|
||||||
|
@ -25,40 +32,56 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
find_path(SDLTTF_INCLUDE_DIR SDL_ttf.h
|
if(NOT SDL_TTF_INCLUDE_DIR AND SDLTTF_INCLUDE_DIR)
|
||||||
|
set(SDL_TTF_INCLUDE_DIR ${SDLTTF_INCLUDE_DIR} CACHE PATH "directory cache
|
||||||
|
entry initialized from old variable name")
|
||||||
|
endif()
|
||||||
|
find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLTTFDIR
|
ENV SDLTTFDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATH_SUFFIXES include include/SDL
|
PATH_SUFFIXES SDL SDL12 SDL11
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/include/SDL12
|
|
||||||
/usr/local/include/SDL11 # FreeBSD ports
|
|
||||||
/usr/include/SDL12
|
|
||||||
/usr/include/SDL11
|
|
||||||
/sw # Fink
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt/csw # Blastwave
|
|
||||||
/opt
|
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(SDLTTF_LIBRARY
|
if(NOT SDL_TTF_LIBRARY AND SDLTTF_LIBRARY)
|
||||||
|
set(SDL_TTF_LIBRARY ${SDLTTF_LIBRARY} CACHE FILEPATH "file cache entry
|
||||||
|
initialized from old variable name")
|
||||||
|
endif()
|
||||||
|
find_library(SDL_TTF_LIBRARY
|
||||||
NAMES SDL_ttf
|
NAMES SDL_ttf
|
||||||
HINTS
|
HINTS
|
||||||
ENV SDLTTFDIR
|
ENV SDLTTFDIR
|
||||||
ENV SDLDIR
|
ENV SDLDIR
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/sw
|
|
||||||
/opt/local
|
|
||||||
/opt/csw
|
|
||||||
/opt
|
|
||||||
PATH_SUFFIXES lib
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(SDL_TTF_INCLUDE_DIR AND EXISTS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h")
|
||||||
|
file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$")
|
||||||
|
file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MAJOR "${SDL_TTF_VERSION_MAJOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MINOR "${SDL_TTF_VERSION_MINOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_PATCH "${SDL_TTF_VERSION_PATCH_LINE}")
|
||||||
|
set(SDL_TTF_VERSION_STRING ${SDL_TTF_VERSION_MAJOR}.${SDL_TTF_VERSION_MINOR}.${SDL_TTF_VERSION_PATCH})
|
||||||
|
unset(SDL_TTF_VERSION_MAJOR_LINE)
|
||||||
|
unset(SDL_TTF_VERSION_MINOR_LINE)
|
||||||
|
unset(SDL_TTF_VERSION_PATCH_LINE)
|
||||||
|
unset(SDL_TTF_VERSION_MAJOR)
|
||||||
|
unset(SDL_TTF_VERSION_MINOR)
|
||||||
|
unset(SDL_TTF_VERSION_PATCH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SDL_TTF_LIBRARIES ${SDL_TTF_LIBRARY})
|
||||||
|
set(SDL_TTF_INCLUDE_DIRS ${SDL_TTF_INCLUDE_DIR})
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_ttf
|
||||||
REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR)
|
REQUIRED_VARS SDL_TTF_LIBRARIES SDL_TTF_INCLUDE_DIRS
|
||||||
|
VERSION_VAR SDL_TTF_VERSION_STRING)
|
||||||
|
|
||||||
|
# for backward compatiblity
|
||||||
|
set(SDLTTF_LIBRARY ${SDL_TTF_LIBRARIES})
|
||||||
|
set(SDLTTF_INCLUDE_DIR ${SDL_TTF_INCLUDE_DIRS})
|
||||||
|
set(SDLTTF_FOUND ${SDL_TTF_FOUND})
|
||||||
|
|
||||||
|
mark_as_advanced(SDL_TTF_LIBRARY SDL_TTF_INCLUDE_DIR)
|
||||||
|
|
Loading…
Reference in New Issue