[sword-svn] r2730 - in trunk: . cmake

greg.hellings at crosswire.org greg.hellings at crosswire.org
Tue Aug 28 20:47:37 MST 2012


Author: greg.hellings
Date: 2012-08-28 20:47:37 -0700 (Tue, 28 Aug 2012)
New Revision: 2730

Modified:
   trunk/CMakeLists.txt
   trunk/cmake/FindICU.cmake
Log:
Patch from Debian/Ubuntu to handle ICU output properly.

Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2012-08-29 03:46:09 UTC (rev 2729)
+++ trunk/CMakeLists.txt	2012-08-29 03:47:37 UTC (rev 2730)
@@ -171,6 +171,7 @@
 ENDIF(WITH_CLUCENE)
 IF(WITH_ICU)
 	INCLUDE_DIRECTORIES(${ICU_INCLUDE_DIRS})
+	ADD_DEFINITIONS(${ICU_DEFINITIONS})
 	SET(SWORD_LINK_LIBRARIES ${SWORD_LINK_LIBRARIES} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
 ENDIF(WITH_ICU)
 IF(REGEX_FOUND AND CROSS_COMPILE_MINGW32)

Modified: trunk/cmake/FindICU.cmake
===================================================================
--- trunk/cmake/FindICU.cmake	2012-08-29 03:46:09 UTC (rev 2729)
+++ trunk/cmake/FindICU.cmake	2012-08-29 03:47:37 UTC (rev 2730)
@@ -5,6 +5,7 @@
 #  ICU_INCLUDE_DIRS   - Directory to include to get ICU headers
 #                       Note: always include ICU headers as, e.g., 
 #                       unicode/utypes.h
+#  ICU_DEFINITIONS    - Definitions
 #  ICU_LIBRARIES      - Libraries to link against for the common ICU
 #  ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation
 #                       (note: in addition to ICU_LIBRARIES)
@@ -26,14 +27,15 @@
 
   # Get include directories
   execute_process(COMMAND "${ICU_CONFIG_BIN}" ${ICU_CONFIG_OPTS} "--cppflags"
-    OUTPUT_VARIABLE ICU_INCLUDE_DIR
+    OUTPUT_VARIABLE ICU_CPPFLAGS
     OUTPUT_STRIP_TRAILING_WHITESPACE
   )
   # Sanitize output
+  string(REGEX MATCHALL "-I[^ ]*\ |-I[^ ]*$" ICU_INCLUDE_DIR ${ICU_CPPFLAGS})
+  string(REGEX MATCHALL "-D[^ ]*\ |-D[^ ]*$" ICU_DEFINITIONS ${ICU_CPPFLAGS})
   string(REPLACE "-I" "" ICU_INCLUDE_DIR ${ICU_INCLUDE_DIR})
-  string(REGEX REPLACE "^[ 	]+" "" ICU_INCLUDE_DIR ${ICU_INCLUDE_DIR})
 
-     # Try to get the Libraries we need
+  # Try to get the Libraries we need
   execute_process(COMMAND "${ICU_CONFIG_BIN}" ${ICU_CONFIG_OPTS} "--ldflags"
     OUTPUT_VARIABLE ICU_LIBRARY_RAW
     OUTPUT_STRIP_TRAILING_WHITESPACE




More information about the sword-cvs mailing list