diff options
-rw-r--r-- | modules/FindGettext.cmake | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/modules/FindGettext.cmake b/modules/FindGettext.cmake index 8c50e43f..e35dceda 100644 --- a/modules/FindGettext.cmake +++ b/modules/FindGettext.cmake @@ -19,28 +19,31 @@ if (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) # in cache already - SET(GETTEXT_FOUND TRUE) + set(GETTEXT_FOUND TRUE) else (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) - include(CheckIncludeFiles) include(CheckLibraryExists) include(CheckFunctionExists) - - check_include_files(libintl.h HAVE_LIBINTL_H) - - set(GETTEXT_INCLUDE_DIR) + + find_path(GETTEXT_INCLUDE_DIR libintl.h) + if(GETTEXT_INCLUDE_DIR) + set(HAVE_LIBINTL_H 1) + else(GETTEXT_INCLUDE_DIR) + set(HAVE_LIBINTL_H 0) + endif(GETTEXT_INCLUDE_DIR) + set(GETTEXT_LIBRARIES) - + if (HAVE_LIBINTL_H) check_function_exists(dgettext LIBC_HAS_DGETTEXT) if (LIBC_HAS_DGETTEXT) set(GETTEXT_SOURCE "built in libc") set(GETTEXT_FOUND TRUE) else (LIBC_HAS_DGETTEXT) - FIND_LIBRARY(LIBINTL_LIBRARY NAMES intl libintl ) + find_library(LIBINTL_LIBRARY NAMES intl libintl ) - CHECK_LIBRARY_EXISTS(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT) + check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT) if (LIBINTL_HAS_DGETTEXT) set(GETTEXT_SOURCE "in ${LIBINTL_LIBRARY}") set(GETTEXT_LIBRARIES ${LIBINTL_LIBRARY}) @@ -59,7 +62,7 @@ else (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) endif (Gettext_FIND_REQUIRED) endif (GETTEXT_FOUND) - MARK_AS_ADVANCED(GETTEXT_INCLUDE_DIR GETTEXT_LIBRARIES) + mark_as_advanced(GETTEXT_INCLUDE_DIR GETTEXT_LIBRARIES) endif (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) |