diff options
author | Alexander Neundorf <neundorf@kde.org> | 2009-01-02 16:20:12 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2009-01-02 16:20:12 +0000 |
commit | 26c3c040c23e00ad5cdf4053429870365d0097f2 (patch) | |
tree | 3c5cf6b3c05e00c172cdc801d3774305f28067c5 | |
parent | e6960bcec4ab88337f7c25b53a4e1947651da380 (diff) | |
download | extra-cmake-modules-26c3c040c23e00ad5cdf4053429870365d0097f2.tar.gz extra-cmake-modules-26c3c040c23e00ad5cdf4053429870365d0097f2.tar.bz2 |
-replace check_include_files() with find_path(), should fix the problem on OSX where libintl.h is in /opt/somewhere.../ and was not found by check_include_files()
Alex
svn path=/trunk/KDE/kdelibs/; revision=904608
-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) |