diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-10-21 22:48:21 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-10-21 22:48:21 -0400 |
commit | cbb6dcfb002dd5bc5f702a4909306be5c2878319 (patch) | |
tree | f5321b16bc6eb2e5f32dd9aa3cdf9f9fe9185466 /cmake/FindICU.cmake | |
parent | 1af3b165c9377702ca62a64112bc089a6f575c30 (diff) |
Imported Upstream version 2.0
Diffstat (limited to 'cmake/FindICU.cmake')
-rw-r--r-- | cmake/FindICU.cmake | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake new file mode 100644 index 0000000..9dff9f3 --- /dev/null +++ b/cmake/FindICU.cmake @@ -0,0 +1,51 @@ +# Finds the International Components for Unicode (ICU) Library +# +# ICU_FOUND - True if ICU found. +# ICU_I18N_FOUND - True if ICU's internationalization library found. +# ICU_INCLUDE_DIRS - Directory to include to get ICU headers +# Note: always include ICU headers as, e.g., +# unicode/utypes.h +# 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) + +# 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) + set(ICU_FOUND 1) + set(ICU_LIBRARIES ${ICU_LIBRARY}) + set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR}) + + # Look for the ICU internationalization libraries + find_library( + ICU_I18N_LIBRARY + NAMES icuin icui18n cygicuin cygicuin32 + DOC "Libraries to link against for ICU internationalization") + mark_as_advanced(ICU_I18N_LIBRARY) + if (ICU_I18N_LIBRARY) + set(ICU_I18N_FOUND 1) + set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY}) + else (ICU_I18N_LIBRARY) + set(ICU_I18N_FOUND 0) + set(ICU_I18N_LIBRARIES) + endif (ICU_I18N_LIBRARY) +else(ICU_INCLUDE_DIR AND ICU_LIBRARY) + set(ICU_FOUND 0) + set(ICU_I18N_FOUND 0) + set(ICU_LIBRARIES) + set(ICU_I18N_LIBRARIES) + set(ICU_INCLUDE_DIRS) +endif(ICU_INCLUDE_DIR AND ICU_LIBRARY) |