aboutsummaryrefslogtreecommitdiff
path: root/src/nodetimer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/nodetimer.cpp')
0 files changed, 0 insertions, 0 deletions
6 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

set(CUSTOM_GETTEXT_PATH "${PROJECT_SOURCE_DIR}/../../gettext"
	CACHE FILEPATH "path to custom gettext")

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")

set(GETTEXT_REQUIRED_VARS GETTEXT_INCLUDE_DIR GETTEXT_MSGFMT)

if(APPLE)
	find_library(GETTEXT_LIBRARY
		NAMES libintl.a
		PATHS "${CUSTOM_GETTEXT_PATH}/lib"
		DOC "GetText library")

	find_library(ICONV_LIBRARY
		NAMES libiconv.dylib
		PATHS "/usr/lib"
		DOC "IConv library")
	set(GETTEXT_REQUIRED_VARS ${GETTEXT_REQUIRED_VARS} GETTEXT_LIBRARY ICONV_LIBRARY)
endif(APPLE)

# Modern Linux, as well as OSX, does not require special linking because
# GetText is part of glibc.
# TODO: check the requirements on other BSDs and older Linux
if(WIN32)
	if(MSVC)
		set(GETTEXT_LIB_NAMES
			libintl.lib intl.lib libintl3.lib intl3.lib)
	else()
		set(GETTEXT_LIB_NAMES
			libintl.dll.a intl.dll.a libintl3.dll.a intl3.dll.a)
	endif()
	find_library(GETTEXT_LIBRARY
		NAMES ${GETTEXT_LIB_NAMES}
		PATHS "${CUSTOM_GETTEXT_PATH}/lib"
		DOC "GetText library")
endif(WIN32)


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GettextLib DEFAULT_MSG ${GETTEXT_REQUIRED_VARS})


if(GETTEXTLIB_FOUND)
	# BSD variants require special linkage as they don't use glibc
	if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
		set(GETTEXT_LIBRARY "intl")
	endif()