summaryrefslogtreecommitdiff
path: root/cmake/FindICU.cmake
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
commit7a00574163029c0c2b649878c95d5acbd083564a (patch)
treec13cc5736025834df2874ed87ee8598070025ea6 /cmake/FindICU.cmake
parentb745315323de9f27538edac9453205ca70e6186e (diff)
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'cmake/FindICU.cmake')
-rw-r--r--cmake/FindICU.cmake73
1 files changed, 13 insertions, 60 deletions
diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake
index 7b84bed..9dff9f3 100644
--- a/cmake/FindICU.cmake
+++ b/cmake/FindICU.cmake
@@ -9,66 +9,19 @@
# ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation
# (note: in addition to ICU_LIBRARIES)
-# Our first goal is to find the icu-config script, if possible
-find_program(
- ICU_CONFIG_BIN
- icu-config
-)
-find_program(
- ICU_GENRB
- genrb
-)
-
-if(ICU_CONFIG_BIN)
- MESSAGE(STATUS "icu-config found at ${ICU_CONFIG_BIN}: Using that for configuration")
- MESSAGE(STATUS "genrb found at ${ICU_GENRB}: Using that for generating transliteration data")
-
- # Get include directories
- execute_process(COMMAND "${ICU_CONFIG_BIN}" "--cppflags"
- OUTPUT_VARIABLE ICU_INCLUDE_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- # Sanitize output
- 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
- execute_process(COMMAND "${ICU_CONFIG_BIN}" "--ldflags"
- OUTPUT_VARIABLE ICU_LIBRARY_RAW
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- execute_process(COMMAND "${ICU_CONFIG_BIN}" "--ldflags-icuio"
- OUTPUT_VARIABLE ICU_LIBRARY_IO_RAW
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- string(REGEX REPLACE "^[ ]+" "" ICU_LIBRARY ${ICU_LIBRARY_RAW})
- string(REGEX REPLACE "^[ ]+" "" ICU_LIBRARY_IO ${ICU_LIBRARY_IO_RAW})
- # Combine them
- set(ICU_LIBRARY "${ICU_LIBRARY} ${ICU_LIBRARY_IO_RAW}")
-
- # Get the version
- execute_process(COMMAND "${ICU_CONFIG_BIN}" "--version"
- OUTPUT_VARIABLE ICU_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-else(ICU_CONFIG_BIN)
-
- # Look for the header file.
- find_path(
- ICU_INCLUDE_DIR
- NAMES unicode/utypes.h
- DOC "Include directory for the ICU library")
- mark_as_advanced(ICU_INCLUDE_DIR)
-
- # Look for the library.
- find_library(
- ICU_LIBRARY
- NAMES icuuc cygicuuc cygicuuc32
- DOC "Libraries to link against for the common parts of ICU")
- mark_as_advanced(ICU_LIBRARY)
-endif(ICU_CONFIG_BIN)
+# Look for the header file.
+find_path(
+ ICU_INCLUDE_DIR
+ NAMES unicode/utypes.h
+ DOC "Include directory for the ICU library")
+mark_as_advanced(ICU_INCLUDE_DIR)
+
+# Look for the library.
+find_library(
+ ICU_LIBRARY
+ NAMES icuuc cygicuuc cygicuuc32
+ DOC "Libraries to link against for the common parts of ICU")
+mark_as_advanced(ICU_LIBRARY)
# Copy the results to the output variables.
if(ICU_INCLUDE_DIR AND ICU_LIBRARY)