[Tux4kids-commits] r495 - in tuxmath/trunk: . cmake-modules

tholy-guest at alioth.debian.org tholy-guest at alioth.debian.org
Wed May 14 11:33:00 UTC 2008


Author: tholy-guest
Date: 2008-05-14 11:32:59 +0000 (Wed, 14 May 2008)
New Revision: 495

Added:
   tuxmath/trunk/cmake-modules/FindSDL_Pango.cmake
Modified:
   tuxmath/trunk/CMakeLists.txt
   tuxmath/trunk/config.h.cmake
Log:
CMake support for SDL_Pango.


Modified: tuxmath/trunk/CMakeLists.txt
===================================================================
--- tuxmath/trunk/CMakeLists.txt	2008-05-14 11:31:46 UTC (rev 494)
+++ tuxmath/trunk/CMakeLists.txt	2008-05-14 11:32:59 UTC (rev 495)
@@ -88,7 +88,13 @@
 endif (ENABLE_NLS)
 message("ENABLE_NLS ${ENABLE_NLS}")
 set(HAVE_GETTEXT ENABLE_NLS)
+# Check to see if we have SDL_Pango support for the right-to-left languages
+if (ENABLE_NLS)
+  find_package(SDL_Pango)
+  set(SDL_Pango ${SDLPANGO_FOUND})  # For the config.h file
+endif (ENABLE_NLS)
 
+
 ## Run configure checks
 if (TUXMATH_BUILD_INTL)
   include(ConfigureChecksIntl)

Added: tuxmath/trunk/cmake-modules/FindSDL_Pango.cmake
===================================================================
--- tuxmath/trunk/cmake-modules/FindSDL_Pango.cmake	                        (rev 0)
+++ tuxmath/trunk/cmake-modules/FindSDL_Pango.cmake	2008-05-14 11:32:59 UTC (rev 495)
@@ -0,0 +1,83 @@
+# - Locate SDL_Pango library
+# This module defines
+#  SDLPANGO_LIBRARY, the library to link against
+#  SDLPANGO_FOUND, if false, do not try to link to SDL
+#  SDLPANGO_INCLUDE_DIR, where to find SDL/SDL.h
+#   
+# $SDLDIR is an environment variable that would
+# correspond to the ./configure --prefix=$SDLDIR
+# used in building SDL.
+# Created by Tim Holy. This was influenced by the FindSDL_ttf.cmake
+# module by Eric Wing.
+# An SDL_Pango framework doesn't seem to exist for OS X, so the rest
+# of the comments below are probably not relevant.
+# This has modifications to recognize OS X frameworks and 
+# additional Unix paths (FreeBSD, etc).
+# On OSX, this will prefer the Framework version (if found) over others.
+# People will have to manually change the cache values of 
+# SDLPANGO_LIBRARY to override this selection.
+FIND_PATH(SDLPANGO_INCLUDE_DIR SDL_Pango.h
+  $ENV{SDLPANGODIR}/include
+  $ENV{SDLDIR}/include
+  ~/Library/Frameworks/SDL_Pango.framework/Headers
+  /Library/Frameworks/SDL_Pango.framework/Headers
+  /usr/local/include/SDL
+  /usr/include/SDL
+  /usr/local/include/SDL12
+  /usr/local/include/SDL11 # FreeBSD ports
+  /usr/include/SDL12
+  /usr/include/SDL11
+  /usr/local/include
+  /usr/include
+  /sw/include/SDL # Fink
+  /sw/include
+  /opt/local/include/SDL # DarwinPorts
+  /opt/local/include
+  /opt/csw/include/SDL # Blastwave
+  /opt/csw/include 
+  /opt/include/SDL
+  /opt/include
+  )
+# I'm not sure if I should do a special casing for Apple. It is 
+# unlikely that other Unix systems will find the framework path.
+# But if they do ([Next|Open|GNU]Step?), 
+# do they want the -framework option also?
+IF(${SDLPANGO_INCLUDE_DIR} MATCHES ".framework")
+  # Extract the path the framework resides in so we can use it for the -F flag
+  STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" SDLPANGO_FRAMEWORK_PATH_TEMP ${SDLPANGO_INCLUDE_DIR})
+  IF("${SDLPANGO_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
+      OR "${SDLPANGO_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
+      )
+    # String is in default search path, don't need to use -F
+    SET(SDLPANGO_LIBRARY "-framework SDL_Pango" CACHE STRING "SDL_Pango framework for OSX")
+  ELSE("${SDLPANGO_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
+      OR "${SDLPANGO_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
+      )
+    # String is not /Library/Frameworks, need to use -F
+    SET(SDLPANGO_LIBRARY "-F${SDLPANGO_FRAMEWORK_PATH_TEMP} -framework SDL_Pango" CACHE STRING "SDL_Pango framework for OSX")
+  ENDIF("${SDLPANGO_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
+    OR "${SDLPANGO_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
+    )
+  # Clear the temp variable so nobody can see it
+  SET(SDLPANGO_FRAMEWORK_PATH_TEMP "" CACHE INTERNAL "")
+
+ELSE(${SDLPANGO_INCLUDE_DIR} MATCHES ".framework")
+  FIND_LIBRARY(SDLPANGO_LIBRARY 
+    NAMES SDL_Pango
+    PATHS
+    $ENV{SDLPANGODIR}/lib
+    $ENV{SDLDIR}/lib
+    /usr/local/lib
+    /usr/lib
+    /sw/lib
+    /opt/local/lib
+    /opt/csw/lib
+    /opt/lib
+    )
+ENDIF(${SDLPANGO_INCLUDE_DIR} MATCHES ".framework")
+
+SET(SDLPANGO_FOUND "NO")
+IF(SDLPANGO_LIBRARY)
+  SET(SDLPANGO_FOUND "YES")
+ENDIF(SDLPANGO_LIBRARY)
+

Modified: tuxmath/trunk/config.h.cmake
===================================================================
--- tuxmath/trunk/config.h.cmake	2008-05-14 11:31:46 UTC (rev 494)
+++ tuxmath/trunk/config.h.cmake	2008-05-14 11:32:59 UTC (rev 495)
@@ -2,4 +2,5 @@
 #cmakedefine HAVE_SCANDIR 1
 
 #cmakedefine HAVE_GETTEXT 1
-#cmakedefine ENABLE_NLS 1
\ No newline at end of file
+#cmakedefine ENABLE_NLS 1
+#cmakedefine SDL_Pango 1




More information about the Tux4kids-commits mailing list