[sword-svn] r3657 - in trunk: . tests

greg.hellings at crosswire.org greg.hellings at crosswire.org
Thu Jun 13 12:08:45 MST 2019


Author: greg.hellings
Date: 2019-06-13 12:08:45 -0700 (Thu, 13 Jun 2019)
New Revision: 3657

Modified:
   trunk/CMakeLists.txt
   trunk/tests/CMakeLists.txt
Log:
Use built-in ICU detection

CMake has introduced a standard FindICU module. Use that


Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2019-06-13 18:51:58 UTC (rev 3656)
+++ trunk/CMakeLists.txt	2019-06-13 19:08:45 UTC (rev 3657)
@@ -1,5 +1,4 @@
-# TODO: write FindICU (icu-config only for 2.2 and up) -- currently taken from another CMake system
-#       limit pkg-config version to >= 0.14, demo, utilities, doc, tests
+# TODO: limit pkg-config version to >= 0.14, demo, utilities, doc, tests
 #       use BUILD_SHARED_LIBS
 #       convince perl swig bindings to build properly
 #
@@ -56,7 +55,8 @@
 ELSE(MSVC)
 	FIND_PACKAGE(BZIP2 QUIET)
 	FIND_PACKAGE(XZ QUIET)
-	FIND_PACKAGE(ICU QUIET)
+	FIND_PACKAGE(ICU
+	                COMPONENTS data i18n io uc)
 	FIND_PACKAGE(CURL QUIET)
 ENDIF(MSVC)
 FIND_PACKAGE(CLucene QUIET)
@@ -237,7 +237,11 @@
 IF(WITH_ICU)
 	INCLUDE_DIRECTORIES(${ICU_INCLUDE_DIRS})
 	ADD_DEFINITIONS(${ICU_DEFINITIONS})
-	SET(SWORD_LINK_LIBRARIES ${SWORD_LINK_LIBRARIES} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
+	MESSAGE(STATUS "ICU Version: ${ICU_VERSION}")
+	IF("${ICU_VERSION}" VERSION_GREATER "61")
+		ADD_DEFINITIONS(-DU_USING_ICU_NAMESPACE)
+	ENDIF("${ICU_VERSION}" VERSION_GREATER "61")
+	SET(SWORD_LINK_LIBRARIES ${SWORD_LINK_LIBRARIES} ${ICU_LIBRARIES})
 ENDIF(WITH_ICU)
 IF(REGEX_FOUND AND CROSS_COMPILE_MINGW32)
 	SET(SWORD_LINK_LIBRARIES ${SWORD_LINK_LIBRARIES} ${REGEX_LIBRARY})

Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt	2019-06-13 18:51:58 UTC (rev 3656)
+++ trunk/tests/CMakeLists.txt	2019-06-13 19:08:45 UTC (rev 3657)
@@ -76,10 +76,12 @@
 
 ########################################################################################
 # The following tests require extra libraries to run
-# 
-FOREACH(ICUTEST icutest translittest)
-	TARGET_LINK_LIBRARIES(${ICUTEST} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
-ENDFOREACH(ICUTEST icutest translittest)
+#
+IF(WITH_ICU)
+	FOREACH(ICUTEST icutest translittest)
+		TARGET_LINK_LIBRARIES(${ICUTEST} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
+	ENDFOREACH(ICUTEST icutest translittest)
+ENDIF(WITH_ICU)
 
 # Excluded until I know we have the tests working
 ADD_SUBDIRECTORY(testsuite)




More information about the sword-cvs mailing list