[Cmake-commits] CMake branch, next, updated. v2.8.9-483-g1d00f3f

Benjamin Eikel cmake at eikel.org
Tue Sep 11 15:31:22 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  1d00f3fac5733b37b14d0cef3ebf8ba2e1419883 (commit)
       via  ddbcbdf8208e70949926e6598569f68e004049e0 (commit)
       via  e020265789dbbd93c355b4ffb7c5942de74201a7 (commit)
       via  7e4f3b39548ecfc5f282aa0348ad92a147b2ff76 (commit)
       via  783fd0c96be95e8b18b7b5fb3bd1b14d55f68408 (commit)
       via  7b284207117f90e88288eb4483f2098166e84268 (commit)
       via  fad039b8b2879b2f00180af396a062f498144684 (commit)
       via  002dfdbeede03f1dc3c5aa31988d2f4f6ba101f9 (commit)
       via  df31f53cdac547caa70cb69891538e6a5c2bd1f4 (commit)
       via  1c4bc1a345c71cb051eddd93a15199b8a589a5a1 (commit)
       via  193e7bf9ed962388b58e196177ffdff41f86cd7c (commit)
       via  09b5a3fd690932b895be00189c9834a22ed61f4f (commit)
       via  f4a84c5a55a962233552671468547c750288f84a (commit)
       via  d27cf10dfa33c43e86225299fe974f545fb187cd (commit)
       via  5cc1669bf59a6d020e3fdccae42af2b020c9c0a9 (commit)
       via  e8e4ae1416e0c7b611440155660d37a15176a278 (commit)
       via  a0c1624feaf760b3ba67d0f2ee46011ff2acc3eb (commit)
       via  390403c3eed30ba7e48e4a75782d167ff380bc0e (commit)
       via  a11d089c9b374f31f79d1939466dd2297c9a6d0c (commit)
       via  18e95ad1cfb5ff28a0cfba4553dee76238b1e6c8 (commit)
      from  1945d61f7a08f925921af3ebd957b0303f6eb342 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1d00f3fac5733b37b14d0cef3ebf8ba2e1419883
commit 1d00f3fac5733b37b14d0cef3ebf8ba2e1419883
Merge: 1945d61 ddbcbdf
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 11 15:31:19 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Sep 11 15:31:19 2012 -0400

    Merge topic 'ImproveFindSDLxxxModules' into next
    
    ddbcbdf Remove paths that are set by default from PATHS for find_... calls
    e020265 Add my copyright tag
    7e4f3b3 Add version support for FindSDL
    783fd0c Format documentation
    7b28420 Update documentation
    fad039b Add version support for FindSDL_ttf
    002dfdb Use SDL_TTF prefix for variables.
    df31f53 Update documentation
    1c4bc1a Add version support for FindSDL_mixer
    193e7bf Use SDL_MIXER prefix for variables.
    09b5a3f Pass SDL_SOUND_LIBRARY to FIND_PACKAGE_HANDLE_STANDARD_ARGS
    f4a84c5 Use same capitalization for FIND_PACKAGE_HANDLE_STANDARD_ARGS as file name
    d27cf10 Version support for FindSDL_sound
    5cc1669 Format the documentation
    e8e4ae1 Add "cmake_minimum_required" to "try_compile" project to suppress warning
    a0c1624 Use SDL_IMAGE prefix for varibales
    ...


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ddbcbdf8208e70949926e6598569f68e004049e0
commit ddbcbdf8208e70949926e6598569f68e004049e0
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 17:20:37 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 17:20:37 2012 +0200

    Remove paths that are set by default from PATHS for find_... calls

diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 1f5e780..5cc219f 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -70,18 +70,7 @@
 find_path(SDL_INCLUDE_DIR SDL.h
   HINTS
     ENV SDLDIR
-  PATH_SUFFIXES include/SDL include
-  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
+  PATH_SUFFIXES SDL SDL12 SDL11
 )
 
 # SDL-1.1 is the name used by FreeBSD ports...
@@ -90,12 +79,6 @@ find_library(SDL_LIBRARY_TEMP
   NAMES SDL SDL-1.1
   HINTS
     ENV SDLDIR
-  PATH_SUFFIXES lib
-  PATHS
-  /sw
-  /opt/local
-  /opt/csw
-  /opt
 )
 
 if(NOT SDL_BUILDING_LIBRARY)
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index f54180d..e3d5761 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -36,18 +36,7 @@ find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h
   HINTS
     ENV SDLIMAGEDIR
     ENV SDLDIR
-  PATH_SUFFIXES include include/SDL
-  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
+  PATH_SUFFIXES SDL SDL12 SDL11
 )
 
 find_library(SDL_IMAGE_LIBRARY
@@ -55,14 +44,6 @@ find_library(SDL_IMAGE_LIBRARY
   HINTS
     ENV SDLIMAGEDIR
     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")
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 7a935c4..61fe1ae 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -36,18 +36,7 @@ find_path(SDL_MIXER_INCLUDE_DIR SDL_mixer.h
   HINTS
     ENV SDLMIXERDIR
     ENV SDLDIR
-  PATH_SUFFIXES include include/SDL
-  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
+  PATH_SUFFIXES SDL SDL12 SDL11
 )
 
 find_library(SDL_MIXER_LIBRARY
@@ -55,14 +44,6 @@ find_library(SDL_MIXER_LIBRARY
   HINTS
     ENV SDLMIXERDIR
     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")
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index 59a5d67..954c81d 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -36,32 +36,14 @@ find_path(SDL_NET_INCLUDE_DIR SDL_net.h
   HINTS
     ENV SDLNETDIR
     ENV SDLDIR
-  PATH_SUFFIXES include include/SDL
-  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
+  PATH_SUFFIXES SDL SDL12 SDL11
 )
+
 find_library(SDL_NET_LIBRARY
   NAMES SDL_net
   HINTS
     ENV SDLNETDIR
     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")
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 7c4b04e..5ff50be 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -77,17 +77,7 @@ find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h
   HINTS
     ENV SDLSOUNDDIR
     ENV SDLDIR
-  PATH_SUFFIXES
-    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
+  PATH_SUFFIXES SDL SDL12 SDL11
   )
 
 find_library(SDL_SOUND_LIBRARY
@@ -95,13 +85,6 @@ find_library(SDL_SOUND_LIBRARY
   HINTS
     ENV SDLSOUNDDIR
     ENV SDLDIR
-  PATH_SUFFIXES
-    lib
-  PATHS
-  /sw
-  /opt/local
-  /opt/csw
-  /opt
   )
 
 if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 533b59f..c8b7a77 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -36,18 +36,7 @@ find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
   HINTS
     ENV SDLTTFDIR
     ENV SDLDIR
-  PATH_SUFFIXES include include/SDL
-  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
+  PATH_SUFFIXES SDL SDL12 SDL11
 )
 
 find_library(SDL_TTF_LIBRARY
@@ -55,14 +44,6 @@ find_library(SDL_TTF_LIBRARY
   HINTS
     ENV SDLTTFDIR
     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")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e020265789dbbd93c355b4ffb7c5942de74201a7
commit e020265789dbbd93c355b4ffb7c5942de74201a7
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:59:23 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:59:23 2012 +0200

    Add my copyright tag

diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 9fb5002..1f5e780 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -55,6 +55,7 @@
 
 #=============================================================================
 # Copyright 2003-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index d176691..f54180d 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -20,6 +20,7 @@
 
 #=============================================================================
 # Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 1d5839d..7a935c4 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -20,6 +20,7 @@
 
 #=============================================================================
 # Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index 48ac775..59a5d67 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -20,6 +20,7 @@
 
 #=============================================================================
 # Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 074f65d..7c4b04e 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -57,6 +57,7 @@
 
 #=============================================================================
 # Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 3a7027d..533b59f 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -20,6 +20,7 @@
 
 #=============================================================================
 # Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e4f3b39548ecfc5f282aa0348ad92a147b2ff76
commit 7e4f3b39548ecfc5f282aa0348ad92a147b2ff76
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:21:16 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:21:16 2012 +0200

    Add version support for FindSDL

diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 22a71b3..9fb5002 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -3,6 +3,7 @@
 #  SDL_LIBRARY, the name of the library to link against
 #  SDL_FOUND, if false, do not try to link to SDL
 #  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:
 #  SDL_BUILDING_LIBRARY
@@ -167,7 +168,24 @@ if(SDL_LIBRARY_TEMP)
   set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
 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)
 
 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)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=783fd0c96be95e8b18b7b5fb3bd1b14d55f68408
commit 783fd0c96be95e8b18b7b5fb3bd1b14d55f68408
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:16:20 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:16:20 2012 +0200

    Format documentation

diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 487c5d3..22a71b3 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -1,16 +1,16 @@
-# Locate SDL library
+# - Locate SDL library
 # This module defines
-# SDL_LIBRARY, the name of the library to link against
-# SDL_FOUND, if false, do not try to link to SDL
-# SDL_INCLUDE_DIR, where to find SDL.h
+#  SDL_LIBRARY, the name of the library to link against
+#  SDL_FOUND, if false, do not try to link to SDL
+#  SDL_INCLUDE_DIR, where to find SDL.h
 #
 # This module responds to the the flag:
-# SDL_BUILDING_LIBRARY
-# If this is defined, then no SDL_main will be linked in because
-# only applications need main().
-# Otherwise, it is assumed you are building an application and this
-# module will attempt to locate and set the the proper link flags
-# as part of the returned SDL_LIBRARY variable.
+#  SDL_BUILDING_LIBRARY
+#    If this is defined, then no SDL_main will be linked in because
+#    only applications need main().
+#    Otherwise, it is assumed you are building an application and this
+#    module will attempt to locate and set the the proper link flags
+#    as part of the returned SDL_LIBRARY variable.
 #
 # Don't forget to include SDLmain.h and SDLmain.m your project for the
 # OS X framework based version. (Other versions link to -lSDLmain which

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b284207117f90e88288eb4483f2098166e84268
commit 7b284207117f90e88288eb4483f2098166e84268
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:12:13 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:12:13 2012 +0200

    Update documentation

diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 7ce775b..3a7027d 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -1,8 +1,14 @@
-# Locate SDL_ttf library
-# This module defines
-# SDLTTF_LIBRARY, the name of the library to link against
-# SDLTTF_FOUND, if false, do not try to link to SDL
-# SDLTTF_INCLUDE_DIR, where to find SDL/SDL.h
+# - Locate SDL_ttf library
+# This module defines:
+#  SDL_TTF_LIBRARIES, the name of the library to link against
+#  SDL_TTF_INCLUDE_DIRS, where to find the headers
+#  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
 # correspond to the ./configure --prefix=$SDLDIR

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fad039b8b2879b2f00180af396a062f498144684
commit fad039b8b2879b2f00180af396a062f498144684
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:11:10 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:11:10 2012 +0200

    Add version support for FindSDL_ttf

diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 3821b36..7ce775b 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -58,13 +58,30 @@ find_library(SDL_TTF_LIBRARY
     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)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_ttf
-                                  REQUIRED_VARS SDL_TTF_LIBRARIES SDL_TTF_INCLUDE_DIRS)
+                                  REQUIRED_VARS SDL_TTF_LIBRARIES SDL_TTF_INCLUDE_DIRS
+                                  VERSION_VAR SDL_TTF_VERSION_STRING)
 
 # for backward compatiblity
 set(SDLTTF_LIBRARY ${SDL_TTF_LIBRARIES})

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=002dfdbeede03f1dc3c5aa31988d2f4f6ba101f9
commit 002dfdbeede03f1dc3c5aa31988d2f4f6ba101f9
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:09:25 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:09:25 2012 +0200

    Use SDL_TTF prefix for variables.

diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 1e68ccf..3821b36 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -25,7 +25,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-find_path(SDLTTF_INCLUDE_DIR SDL_ttf.h
+find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
   HINTS
     ENV SDLTTFDIR
     ENV SDLDIR
@@ -43,7 +43,7 @@ find_path(SDLTTF_INCLUDE_DIR SDL_ttf.h
   /opt
 )
 
-find_library(SDLTTF_LIBRARY
+find_library(SDL_TTF_LIBRARY
   NAMES SDL_ttf
   HINTS
     ENV SDLTTFDIR
@@ -58,7 +58,17 @@ find_library(SDLTTF_LIBRARY
     PATH_SUFFIXES lib
 )
 
+set(SDL_TTF_LIBRARIES ${SDL_TTF_LIBRARY})
+set(SDL_TTF_INCLUDE_DIRS ${SDL_TTF_INCLUDE_DIR})
+
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF
-                                  REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_ttf
+                                  REQUIRED_VARS SDL_TTF_LIBRARIES SDL_TTF_INCLUDE_DIRS)
+
+# 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)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df31f53cdac547caa70cb69891538e6a5c2bd1f4
commit df31f53cdac547caa70cb69891538e6a5c2bd1f4
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:07:10 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:07:10 2012 +0200

    Update documentation

diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 3139ff2..1d5839d 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -1,8 +1,14 @@
-# Locate SDL_mixer library
-# This module defines
-# SDLMIXER_LIBRARY, the name of the library to link against
-# SDLMIXER_FOUND, if false, do not try to link to SDL
-# SDLMIXER_INCLUDE_DIR, where to find SDL/SDL.h
+# - Locate SDL_mixer library
+# This module defines:
+#  SDL_MIXER_LIBRARIES, the name of the library to link against
+#  SDL_MIXER_INCLUDE_DIRS, where to find the headers
+#  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
 # correspond to the ./configure --prefix=$SDLDIR

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c4bc1a345c71cb051eddd93a15199b8a589a5a1
commit 1c4bc1a345c71cb051eddd93a15199b8a589a5a1
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:04:59 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:04:59 2012 +0200

    Add version support for FindSDL_mixer

diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 8e9fce6..3139ff2 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -58,13 +58,30 @@ find_library(SDL_MIXER_LIBRARY
   /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)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_mixer
-                                  REQUIRED_VARS SDL_MIXER_LIBRARIES SDL_MIXER_INCLUDE_DIRS)
+                                  REQUIRED_VARS SDL_MIXER_LIBRARIES SDL_MIXER_INCLUDE_DIRS
+                                  VERSION_VAR SDL_MIXER_VERSION_STRING)
 
 # for backward compatiblity
 set(SDLMIXER_LIBRARY ${SDL_MIXER_LIBRARIES})

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=193e7bf9ed962388b58e196177ffdff41f86cd7c
commit 193e7bf9ed962388b58e196177ffdff41f86cd7c
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:03:18 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:03:18 2012 +0200

    Use SDL_MIXER prefix for variables.

diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 97a8330..8e9fce6 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -25,7 +25,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-find_path(SDLMIXER_INCLUDE_DIR SDL_mixer.h
+find_path(SDL_MIXER_INCLUDE_DIR SDL_mixer.h
   HINTS
     ENV SDLMIXERDIR
     ENV SDLDIR
@@ -43,7 +43,7 @@ find_path(SDLMIXER_INCLUDE_DIR SDL_mixer.h
   /opt
 )
 
-find_library(SDLMIXER_LIBRARY
+find_library(SDL_MIXER_LIBRARY
   NAMES SDL_mixer
   HINTS
     ENV SDLMIXERDIR
@@ -58,7 +58,17 @@ find_library(SDLMIXER_LIBRARY
   /opt
 )
 
+set(SDL_MIXER_LIBRARIES ${SDL_MIXER_LIBRARY})
+set(SDL_MIXER_INCLUDE_DIRS ${SDL_MIXER_INCLUDE_DIR})
+
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER
-                                  REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_mixer
+                                  REQUIRED_VARS SDL_MIXER_LIBRARIES SDL_MIXER_INCLUDE_DIRS)
+
+# 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)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09b5a3fd690932b895be00189c9834a22ed61f4f
commit 09b5a3fd690932b895be00189c9834a22ed61f4f
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 16:00:04 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 16:00:04 2012 +0200

    Pass SDL_SOUND_LIBRARY to FIND_PACKAGE_HANDLE_STANDARD_ARGS

diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 3891c8f..074f65d 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -395,5 +395,5 @@ endif()
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 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)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4a84c5a55a962233552671468547c750288f84a
commit f4a84c5a55a962233552671468547c750288f84a
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 15:56:19 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 15:56:19 2012 +0200

    Use same capitalization for FIND_PACKAGE_HANDLE_STANDARD_ARGS as file name

diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 55d08dc..3891c8f 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -394,6 +394,6 @@ endif()
 
 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
                                   VERSION_VAR SDL_SOUND_VERSION_STRING)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d27cf10dfa33c43e86225299fe974f545fb187cd
commit d27cf10dfa33c43e86225299fe974f545fb187cd
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 15:55:26 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 15:55:26 2012 +0200

    Version support for FindSDL_sound

diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 06b3d54..55d08dc 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -12,6 +12,7 @@
 #    flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
 #    This is available mostly for cases this module failed to anticipate for
 #    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)
 #   SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
@@ -375,7 +376,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")
  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)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND
-                                  REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR)
+                                  REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR
+                                  VERSION_VAR SDL_SOUND_VERSION_STRING)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5cc1669bf59a6d020e3fdccae42af2b020c9c0a9
commit 5cc1669bf59a6d020e3fdccae42af2b020c9c0a9
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 15:48:23 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 15:48:23 2012 +0200

    Format the documentation

diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 0c43e5c..06b3d54 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -1,34 +1,33 @@
-# Locates the SDL_sound library
-
+# - Locates the SDL_sound library
+#
 # This module depends on SDL being found and
 # must be called AFTER FindSDL.cmake is called.
-
+#
 # This module defines
-# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
-# SDL_SOUND_FOUND, if false, do not try to link to SDL
-# 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.
-# 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.
-# This is available mostly for cases this module failed to anticipate for
-# and you must add additional flags. This is marked as ADVANCED.
-
+#  SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
+#  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
+#    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
+#    flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
+#    This is available mostly for cases this module failed to anticipate for
+#    and you must add additional flags. This is marked as ADVANCED.
 #
 # 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
-# against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
+#   SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
+#   against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
 # And might define the following as needed
-# MIKMOD_LIBRARY
-# MODPLUG_LIBRARY
-# OGG_LIBRARY
-# VORBIS_LIBRARY
-# SMPEG_LIBRARY
-# FLAC_LIBRARY
-# SPEEX_LIBRARY
+#   MIKMOD_LIBRARY
+#   MODPLUG_LIBRARY
+#   OGG_LIBRARY
+#   VORBIS_LIBRARY
+#   SMPEG_LIBRARY
+#   FLAC_LIBRARY
+#   SPEEX_LIBRARY
 #
 # Typically, you should not use these variables directly, and you should use
 # SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other audio libraries
-# (if needed) to successfully compile on your system .
+# (if needed) to successfully compile on your system.
 #
 # Created by Eric Wing.
 # This module is a bit more complicated than the other FindSDL* family modules.
@@ -54,7 +53,6 @@
 # People will have to manually change the cache values of
 # SDL_LIBRARY to override this selectionor set the CMake environment
 # CMAKE_INCLUDE_PATH to modify the search paths.
-#
 
 #=============================================================================
 # Copyright 2005-2009 Kitware, Inc.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e8e4ae1416e0c7b611440155660d37a15176a278
commit e8e4ae1416e0c7b611440155660d37a15176a278
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 15:43:07 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 15:43:07 2012 +0200

    Add "cmake_minimum_required" to "try_compile" project to suppress warning

diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index a9153c1..0c43e5c 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -176,7 +176,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
    # in the SDL_LIBRARY string after the "-framework".
    # But if I quote the stuff in INCLUDE_DIRECTORIES, it doesn't work.
    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})
         add_executable(DetermineSoundLibs DetermineSoundLibs.c)
         target_link_libraries(DetermineSoundLibs ${TMP_TRY_LIBS})"

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0c1624feaf760b3ba67d0f2ee46011ff2acc3eb
commit a0c1624feaf760b3ba67d0f2ee46011ff2acc3eb
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 13:35:55 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 13:35:55 2012 +0200

    Use SDL_IMAGE prefix for varibales
    
    This makes FindPackageHandleStandardArgs and FeatureSummary work correctly.
    Keep old variables for compatibility.
    Furthermore, format the documentation.

diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index ae2bc69..d176691 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -1,9 +1,14 @@
-# Locate SDL_image library
-# This module defines
-# SDLIMAGE_LIBRARY, the name of the library to link against
-# SDLIMAGE_FOUND, if false, do not try to link to SDL
-# SDLIMAGE_INCLUDE_DIR, where to find SDL/SDL.h
-# SDLIMAGE_VERSION_STRING - human-readable string containing the version of SDL_image
+# - Locate SDL_image library
+# This module defines:
+#  SDL_IMAGE_LIBRARIES, the name of the library to link against
+#  SDL_IMAGE_INCLUDE_DIRS, where to find the headers
+#  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
 # correspond to the ./configure --prefix=$SDLDIR
@@ -26,7 +31,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-find_path(SDLIMAGE_INCLUDE_DIR SDL_image.h
+find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h
   HINTS
     ENV SDLIMAGEDIR
     ENV SDLDIR
@@ -44,7 +49,7 @@ find_path(SDLIMAGE_INCLUDE_DIR SDL_image.h
   /opt
 )
 
-find_library(SDLIMAGE_LIBRARY
+find_library(SDL_IMAGE_LIBRARY
   NAMES SDL_image
   HINTS
     ENV SDLIMAGEDIR
@@ -59,24 +64,34 @@ find_library(SDLIMAGE_LIBRARY
   /opt
 )
 
-if(SDLIMAGE_INCLUDE_DIR AND EXISTS "${SDLIMAGE_INCLUDE_DIR}/SDL_image.h")
-  file(STRINGS "${SDLIMAGE_INCLUDE_DIR}/SDL_image.h" SDLIMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$")
-  file(STRINGS "${SDLIMAGE_INCLUDE_DIR}/SDL_image.h" SDLIMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$")
-  file(STRINGS "${SDLIMAGE_INCLUDE_DIR}/SDL_image.h" SDLIMAGE_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" SDLIMAGE_VERSION_MAJOR "${SDLIMAGE_VERSION_MAJOR_LINE}")
-  string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDLIMAGE_VERSION_MINOR "${SDLIMAGE_VERSION_MINOR_LINE}")
-  string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDLIMAGE_VERSION_PATCH "${SDLIMAGE_VERSION_PATCH_LINE}")
-  set(SDLIMAGE_VERSION_STRING ${SDLIMAGE_VERSION_MAJOR}.${SDLIMAGE_VERSION_MINOR}.${SDLIMAGE_VERSION_PATCH})
-  unset(SDLIMAGE_VERSION_MAJOR_LINE)
-  unset(SDLIMAGE_VERSION_MINOR_LINE)
-  unset(SDLIMAGE_VERSION_PATCH_LINE)
-  unset(SDLIMAGE_VERSION_MAJOR)
-  unset(SDLIMAGE_VERSION_MINOR)
-  unset(SDLIMAGE_VERSION_PATCH)
+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)
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE
-                                  REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR
-                                  VERSION_VAR SDLIMAGE_VERSION_STRING)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_image
+                                  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)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=390403c3eed30ba7e48e4a75782d167ff380bc0e
commit 390403c3eed30ba7e48e4a75782d167ff380bc0e
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 12:32:18 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 12:32:18 2012 +0200

    Use prefix SDL_NET, because it matches the file name.
    
    Add new variables, keep the old ones for compatibility.
    Format the documentation header.

diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index 39a2f68..48ac775 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -1,9 +1,14 @@
-# Locate SDL_net library
-# This module defines
-# SDLNET_LIBRARY, the name of the library to link against
-# SDLNET_FOUND, if false, do not try to link against
-# SDLNET_INCLUDE_DIR, where to find the headers
-# SDLNET_VERSION_STRING - human-readable string containing the version of SDL_net
+# - Locate SDL_net library
+# This module defines:
+#  SDL_NET_LIBRARIES, the name of the library to link against
+#  SDL_NET_INCLUDE_DIRS, 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
 # correspond to the ./configure --prefix=$SDLDIR
@@ -26,7 +31,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-find_path(SDLNET_INCLUDE_DIR SDL_net.h
+find_path(SDL_NET_INCLUDE_DIR SDL_net.h
   HINTS
     ENV SDLNETDIR
     ENV SDLDIR
@@ -43,7 +48,7 @@ find_path(SDLNET_INCLUDE_DIR SDL_net.h
   /opt/csw # Blastwave
   /opt
 )
-find_library(SDLNET_LIBRARY
+find_library(SDL_NET_LIBRARY
   NAMES SDL_net
   HINTS
     ENV SDLNETDIR
@@ -58,24 +63,34 @@ find_library(SDLNET_LIBRARY
   /opt
 )
 
-if(SDLNET_INCLUDE_DIR AND EXISTS "${SDLNET_INCLUDE_DIR}/SDL_net.h")
-  file(STRINGS "${SDLNET_INCLUDE_DIR}/SDL_net.h" SDLNET_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+[0-9]+$")
-  file(STRINGS "${SDLNET_INCLUDE_DIR}/SDL_net.h" SDLNET_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+[0-9]+$")
-  file(STRINGS "${SDLNET_INCLUDE_DIR}/SDL_net.h" SDLNET_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" SDLNET_VERSION_MAJOR "${SDLNET_VERSION_MAJOR_LINE}")
-  string(REGEX REPLACE "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDLNET_VERSION_MINOR "${SDLNET_VERSION_MINOR_LINE}")
-  string(REGEX REPLACE "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDLNET_VERSION_PATCH "${SDLNET_VERSION_PATCH_LINE}")
-  set(SDLNET_VERSION_STRING ${SDLNET_VERSION_MAJOR}.${SDLNET_VERSION_MINOR}.${SDLNET_VERSION_PATCH})
-  unset(SDLNET_VERSION_MAJOR_LINE)
-  unset(SDLNET_VERSION_MINOR_LINE)
-  unset(SDLNET_VERSION_PATCH_LINE)
-  unset(SDLNET_VERSION_MAJOR)
-  unset(SDLNET_VERSION_MINOR)
-  unset(SDLNET_VERSION_PATCH)
+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)
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET
-                                  REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR
-                                  VERSION_VAR SDLNET_VERSION_STRING)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_net
+                                  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)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a11d089c9b374f31f79d1939466dd2297c9a6d0c
commit a11d089c9b374f31f79d1939466dd2297c9a6d0c
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Tue Sep 4 11:40:06 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Tue Sep 4 11:45:28 2012 +0200

    Version support for FindSDL_image

diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index 8c9e891..ae2bc69 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -3,6 +3,7 @@
 # SDLIMAGE_LIBRARY, the name of the library to link against
 # SDLIMAGE_FOUND, if false, do not try to link to SDL
 # SDLIMAGE_INCLUDE_DIR, where to find SDL/SDL.h
+# SDLIMAGE_VERSION_STRING - human-readable string containing the version of SDL_image
 #
 # $SDLDIR is an environment variable that would
 # correspond to the ./configure --prefix=$SDLDIR
@@ -58,7 +59,24 @@ find_library(SDLIMAGE_LIBRARY
   /opt
 )
 
+if(SDLIMAGE_INCLUDE_DIR AND EXISTS "${SDLIMAGE_INCLUDE_DIR}/SDL_image.h")
+  file(STRINGS "${SDLIMAGE_INCLUDE_DIR}/SDL_image.h" SDLIMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$")
+  file(STRINGS "${SDLIMAGE_INCLUDE_DIR}/SDL_image.h" SDLIMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$")
+  file(STRINGS "${SDLIMAGE_INCLUDE_DIR}/SDL_image.h" SDLIMAGE_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" SDLIMAGE_VERSION_MAJOR "${SDLIMAGE_VERSION_MAJOR_LINE}")
+  string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDLIMAGE_VERSION_MINOR "${SDLIMAGE_VERSION_MINOR_LINE}")
+  string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDLIMAGE_VERSION_PATCH "${SDLIMAGE_VERSION_PATCH_LINE}")
+  set(SDLIMAGE_VERSION_STRING ${SDLIMAGE_VERSION_MAJOR}.${SDLIMAGE_VERSION_MINOR}.${SDLIMAGE_VERSION_PATCH})
+  unset(SDLIMAGE_VERSION_MAJOR_LINE)
+  unset(SDLIMAGE_VERSION_MINOR_LINE)
+  unset(SDLIMAGE_VERSION_PATCH_LINE)
+  unset(SDLIMAGE_VERSION_MAJOR)
+  unset(SDLIMAGE_VERSION_MINOR)
+  unset(SDLIMAGE_VERSION_PATCH)
+endif()
+
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE
-                                  REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR)
+                                  REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR
+                                  VERSION_VAR SDLIMAGE_VERSION_STRING)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18e95ad1cfb5ff28a0cfba4553dee76238b1e6c8
commit 18e95ad1cfb5ff28a0cfba4553dee76238b1e6c8
Author:     Benjamin Eikel <cmake at eikel.org>
AuthorDate: Sat Sep 1 14:10:59 2012 +0200
Commit:     Benjamin Eikel <cmake at eikel.org>
CommitDate: Sat Sep 1 14:10:59 2012 +0200

    Add version support for FindSDL_net

diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index 7e90e90..39a2f68 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -3,6 +3,7 @@
 # SDLNET_LIBRARY, the name of the library to link against
 # SDLNET_FOUND, if false, do not try to link against
 # SDLNET_INCLUDE_DIR, where to find the headers
+# SDLNET_VERSION_STRING - human-readable string containing the version of SDL_net
 #
 # $SDLDIR is an environment variable that would
 # correspond to the ./configure --prefix=$SDLDIR
@@ -57,7 +58,24 @@ find_library(SDLNET_LIBRARY
   /opt
 )
 
+if(SDLNET_INCLUDE_DIR AND EXISTS "${SDLNET_INCLUDE_DIR}/SDL_net.h")
+  file(STRINGS "${SDLNET_INCLUDE_DIR}/SDL_net.h" SDLNET_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+[0-9]+$")
+  file(STRINGS "${SDLNET_INCLUDE_DIR}/SDL_net.h" SDLNET_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+[0-9]+$")
+  file(STRINGS "${SDLNET_INCLUDE_DIR}/SDL_net.h" SDLNET_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" SDLNET_VERSION_MAJOR "${SDLNET_VERSION_MAJOR_LINE}")
+  string(REGEX REPLACE "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDLNET_VERSION_MINOR "${SDLNET_VERSION_MINOR_LINE}")
+  string(REGEX REPLACE "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDLNET_VERSION_PATCH "${SDLNET_VERSION_PATCH_LINE}")
+  set(SDLNET_VERSION_STRING ${SDLNET_VERSION_MAJOR}.${SDLNET_VERSION_MINOR}.${SDLNET_VERSION_PATCH})
+  unset(SDLNET_VERSION_MAJOR_LINE)
+  unset(SDLNET_VERSION_MINOR_LINE)
+  unset(SDLNET_VERSION_PATCH_LINE)
+  unset(SDLNET_VERSION_MAJOR)
+  unset(SDLNET_VERSION_MINOR)
+  unset(SDLNET_VERSION_PATCH)
+endif()
+
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET
-                                  REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR)
+                                  REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR
+                                  VERSION_VAR SDLNET_VERSION_STRING)

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindSDL.cmake       |   60 +++++++++++++++--------------
 Modules/FindSDL_image.cmake |   73 +++++++++++++++++++++--------------
 Modules/FindSDL_mixer.cmake |   73 +++++++++++++++++++++--------------
 Modules/FindSDL_net.cmake   |   74 ++++++++++++++++++++++--------------
 Modules/FindSDL_sound.cmake |   89 ++++++++++++++++++++++---------------------
 Modules/FindSDL_ttf.cmake   |   73 +++++++++++++++++++++--------------
 6 files changed, 253 insertions(+), 189 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list