diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-07-21 12:33:29 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-07-21 12:33:29 +0200 |
commit | b99174cb0c680396373c0190d4c04afa7e28028f (patch) | |
tree | 49fa6c3fccde5a903b2bd4a5d9ec43aa92babc5e /cmake/Modules/FindGettextLib.cmake | |
parent | fd70bbd36785c27fa8ef8229eee79fac32557e42 (diff) | |
download | minetest-b99174cb0c680396373c0190d4c04afa7e28028f.tar.gz minetest-b99174cb0c680396373c0190d4c04afa7e28028f.tar.bz2 minetest-b99174cb0c680396373c0190d4c04afa7e28028f.zip |
Refactor and clean up gettext management
Diffstat (limited to 'cmake/Modules/FindGettextLib.cmake')
-rw-r--r-- | cmake/Modules/FindGettextLib.cmake | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake new file mode 100644 index 000000000..1ef8997f4 --- /dev/null +++ b/cmake/Modules/FindGettextLib.cmake @@ -0,0 +1,48 @@ +# Package finder for gettext libs and include files + +SET(CUSTOM_GETTEXT_PATH "${PROJECT_SOURCE_DIR}/../../gettext" + CACHE FILEPATH "path to custom gettext") + +# by default +SET(GETTEXT_FOUND FALSE) + +FIND_PATH(GETTEXT_INCLUDE_DIR + NAMES libintl.h + PATHS "${CUSTOM_GETTEXT_PATH}/include" + DOC "gettext include directory") + +FIND_PROGRAM(GETTEXT_MSGFMT + NAMES msgfmt + PATHS "${CUSTOM_GETTEXT_PATH}/bin" + DOC "path to msgfmt") + +# modern Linux, as well as Mac, seem to not need require special linking +# TODO check the requirements on other BSDs and older Linux +IF (WIN32) + FIND_LIBRARY(GETTEXT_LIBRARY + NAMES libintl.lib intl.lib libintl3.lib intl3.lib + PATHS "${CUSTOM_GETTEXT_PATH}/lib" + DOC "gettext *intl*.lib") + FIND_LIBRARY(GETTEXT_DLL + NAMES libintl.dll intl.dll libintl3.dll intl3.dll + PATHS "${CUSTOM_GETTEXT_PATH}/lib" + DOC "gettext *intl*.dll") + FIND_LIBRARY(GETTEXT_ICONV_DLL + NAMES libiconv2.dll + PATHS "${CUSTOM_GETTEXT_PATH}/lib" + DOC "gettext *iconv*.lib") +ENDIF(WIN32) + + +IF(GETTEXT_INCLUDE_DIR AND GETTEXT_MSGFMT) + IF (WIN32) + # in the Win32 case check also for the extra linking requirements + IF(GETTEXT_LIBRARY AND GETTEXT_DLL AND GETTEXT_ICONV_DLL) + SET(GETTEXT_FOUND TRUE) + ENDIF() + ELSE(WIN32) + SET(GETTEXT_FOUND TRUE) + ENDIF(WIN32) +ENDIF() + + |