[Tux4kids-commits] r482 - in tuxmath/trunk: . cmake-modules intl src

tholy-guest at alioth.debian.org tholy-guest at alioth.debian.org
Wed May 7 13:53:30 UTC 2008


Author: tholy-guest
Date: 2008-05-07 13:53:29 +0000 (Wed, 07 May 2008)
New Revision: 482

Modified:
   tuxmath/trunk/CMakeLists.txt
   tuxmath/trunk/cmake-modules/FindIconv.cmake
   tuxmath/trunk/cmake-modules/FindMSGFMT.cmake
   tuxmath/trunk/intl/CMakeLists.txt
   tuxmath/trunk/src/CMakeLists.txt
Log:
Provide what looks to be functioning internationalization for the Mac.


Modified: tuxmath/trunk/CMakeLists.txt
===================================================================
--- tuxmath/trunk/CMakeLists.txt	2008-05-06 13:47:39 UTC (rev 481)
+++ tuxmath/trunk/CMakeLists.txt	2008-05-07 13:53:29 UTC (rev 482)
@@ -57,6 +57,9 @@
 endif (APPLE)
 #message("TDP ${TUXMATH_DATA_PREFIX}")
 
+## OS X
+# Build universal binaries on OSX
+set(CMAKE_OSX_ARCHITECTURES ppc i386)
 
 ## Decide on whether we're going to build with internationalization
 # We can't build with internationalization unless the build computer
@@ -89,12 +92,6 @@
 include(ConfigureChecks)
 
 ## Add subdirectories
-add_subdirectory(src)
-add_subdirectory(data)
-add_subdirectory(doc)
-if (ENABLE_NLS)
-  add_subdirectory(po)
-endif (ENABLE_NLS)
 if (TUXMATH_BUILD_INTL)
   set(INTL_BINARY_DIR ${CMAKE_BINARY_DIR}/intl)
   set(INTL_SOURCE_DIR ${CMAKE_SOURCE_DIR}/intl)
@@ -102,6 +99,14 @@
   set(PREFIX ${CMAKE_BINARY_DIR})
   add_subdirectory(intl)
 endif (TUXMATH_BUILD_INTL)
+message("intl_sources1a: ${INTL_SOURCES}")
+add_subdirectory(src)
+add_subdirectory(data)
+add_subdirectory(doc)
+if (ENABLE_NLS)
+  set(LOCALE_INSTALL_DIR ${CMAKE_BINARY_DIR}/src/${LOCALE_DIR})
+  add_subdirectory(po)
+endif (ENABLE_NLS)
 
 #message("TMBD ${TuxMath_BINARY_DIR}")
 #message("TMBN ${TUXMATH_MACOSX_BUNDLE_NAME}")

Modified: tuxmath/trunk/cmake-modules/FindIconv.cmake
===================================================================
--- tuxmath/trunk/cmake-modules/FindIconv.cmake	2008-05-06 13:47:39 UTC (rev 481)
+++ tuxmath/trunk/cmake-modules/FindIconv.cmake	2008-05-07 13:53:29 UTC (rev 482)
@@ -6,6 +6,12 @@
 #  ICONV_LIBRARIES - Link these to use Iconv 
 #  ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
 # 
+# This was mostly borrowed from Strigi.  LyX also has a (quite
+# different) FindICONV: the one in LyX does not check
+# second_argument_is_const, but seems to have more fleshed-out support
+# for WIN32.  There may need to be some merging done.
+# Tim Holy, 2008-05-07
+
 include(CheckCXXSourceCompiles)
 
 IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
@@ -13,9 +19,20 @@
   SET(ICONV_FIND_QUIETLY TRUE)
 ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
 
-FIND_PATH(ICONV_INCLUDE_DIR iconv.h) 
+FIND_PATH(ICONV_INCLUDE_DIR iconv.h
+  /Developer/SDKs/MacOSX10.4u.sdk/usr/include/iconv.h
+  /Developer/SDKs/MacOSX10.5.sdk/usr/include/iconv.h
+  /usr/include
+)
+
  
-FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c)
+FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv2 c
+  PATHS
+  /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
+  /Developer/SDKs/MacOSX10.5.sdk/usr/lib
+ /usr/lib
+)
+  
  
 IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
    SET(ICONV_FOUND TRUE) 

Modified: tuxmath/trunk/cmake-modules/FindMSGFMT.cmake
===================================================================
--- tuxmath/trunk/cmake-modules/FindMSGFMT.cmake	2008-05-06 13:47:39 UTC (rev 481)
+++ tuxmath/trunk/cmake-modules/FindMSGFMT.cmake	2008-05-07 13:53:29 UTC (rev 482)
@@ -8,7 +8,7 @@
 # Macro:
 #  ADD_TRANSLATIONS
 #
-# This requires that the variable LOCALEDIR be set to the place you
+# This requires that the variable LOCALE_INSTALL_DIR be set to the place you
 # want to install the .mo files.
 
 
@@ -41,7 +41,7 @@
 	    COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in}
 	    DEPENDS ${_in} )
 	INSTALL(FILES ${_out}
-	    DESTINATION ${LOCALEDIR}/${_file_we}/LC_MESSAGES/
+	    DESTINATION ${LOCALE_INSTALL_DIR}/${_file_we}/LC_MESSAGES/
 	    RENAME ${_baseName}.mo )
 	SET(_outputs ${_outputs} ${_out})
     ENDFOREACH(_file)

Modified: tuxmath/trunk/intl/CMakeLists.txt
===================================================================
--- tuxmath/trunk/intl/CMakeLists.txt	2008-05-06 13:47:39 UTC (rev 481)
+++ tuxmath/trunk/intl/CMakeLists.txt	2008-05-07 13:53:29 UTC (rev 482)
@@ -19,7 +19,6 @@
 
 project(intl)
 
-set(CMAKE_MODULE_PATH "/home/tim/src/tux4kids/tuxmath/trunk/cmake-modules")
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
 include(CheckFunctionExists)
 
@@ -40,6 +39,7 @@
 if (NOT INTL_SOURCE_DIR)
   set(INTL_SOURCE_DIR ${CMAKE_SOURCE_DIR})
 endif ()
+message("INTL_BINARY_DIR2 ${INTL_BINARY_DIR}")
 
 # Generate the appropriate header files
 configure_file(libgnuintl.h.in ${INTL_BINARY_DIR}/libgnuintl.h)
@@ -75,9 +75,9 @@
 		)
 endif (NOT APPLE)
 
-file(GLOB intl_headers ${INTL_SOURCE_DIR}/*.h)
+file(GLOB INTL_HEADERS ${INTL_SOURCE_DIR}/*.h)
 
-set(intl_sources 
+set(INTL_SOURCES 
       bindtextdom.c
       dcgettext.c
       dgettext.c
@@ -91,6 +91,8 @@
       dcigettext.c
       dcngettext.c
       dngettext.c
+      hash-string.c
+      langprefs.c
       ngettext.c
       plural.c
       plural-exp.c
@@ -103,6 +105,7 @@
       intl-compat.c
 )
 
+message("intl_sources1: ${INTL_SOURCES}")
 
 include_directories(${INTL_BINARY_DIR} ${INTL_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 
@@ -110,11 +113,11 @@
   include_directories(${ICONV_INCLUDE_DIR})
 endif(ICONV_FOUND)
 
-add_library(intl STATIC ${intl_sources} ${intl_headers})
+add_library(intl STATIC ${INTL_SOURCES} ${INTL_HEADERS})
 
 if(ICONV_FOUND)
   target_link_libraries(intl ${ICONV_LIBRARY})
 endif(ICONV_FOUND)
 
-#project_source_group("${GROUP_CODE}" intl_sources intl_headers)
+#project_source_group("${GROUP_CODE}" INTL_SOURCES INTL_HEADERS)
 

Modified: tuxmath/trunk/src/CMakeLists.txt
===================================================================
--- tuxmath/trunk/src/CMakeLists.txt	2008-05-06 13:47:39 UTC (rev 481)
+++ tuxmath/trunk/src/CMakeLists.txt	2008-05-07 13:53:29 UTC (rev 482)
@@ -53,12 +53,15 @@
    configure_file(${TuxMath_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 #endif (NOT ENABLE_NLS)
 #check_include_file(config.h HAVE_CONFIG_H REQUIRED)
-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDLMIXER_INCLUDE_DIR} ${SDLTTF_INCLUDE_DIR} ${TUXMATH_EXTRA_INCLUDES})
 
-## OSX
-# Build universal binaries on OSX
-set(CMAKE_OSX_ARCHITECTURES ppc i386)
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDLMIXER_INCLUDE_DIR} ${SDLTTF_INCLUDE_DIR} ${TUXMATH_EXTRA_INCLUDES} ${INTL_BINARY_DIR})
 
+if (TUXMATH_BUILD_INTL)
+  link_directories(${INTL_BINARY_DIR})
+  message("Added link directory ${INTL_BINARY_DIR}")
+endif(TUXMATH_BUILD_INTL)
+
+
 ## Define the executables
 add_executable (
   tuxmath
@@ -92,6 +95,11 @@
     LINK_FLAGS "-mmacosx-version-min=10.4")
 endif(APPLE)
 
+if (TUXMATH_BUILD_INTL)
+  message("Linking iconv: ${ICONV_LIBRARIES}")
+  target_link_libraries(tuxmath ${ICONV_LIBRARIES} libintl.a)
+endif(TUXMATH_BUILD_INTL)
+
 set_target_properties (
   tuxmathadmin
   PROPERTIES COMPILE_FLAGS 




More information about the Tux4kids-commits mailing list