Commit a776ef82 authored by Emmanuel Christophe's avatar Emmanuel Christophe

BUG: fix gettext for windows and osx

parent ea097dae
......@@ -616,23 +616,26 @@ ENDIF(OTB_USE_EXTERNAL_GDAL)
#Experimental
FIND_PACKAGE(Gettext)
IF(GETTEXT_FOUND)
SET(OTB_I18N 1)
SET(OTB_LANG $ENV{LANG} CACHE STRING "OTB internationalization (Experimental)")#might want to get the Locale from the system here
SET(OTB_LANG_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/I18n)
SUBDIRS(I18n)
FIND_PATH(GETTEXT_INCLUDE_DIR
libintl.h
DOC "Path to gettext include directory (where libintl.h can be found)")
MARK_AS_ADVANCED(GETTEXT_INCLUDE_DIR)
IF(GETTEXT_INCLUDE_DIR)
INCLUDE_DIRECTORIES(${GETTEXT_INCLUDE_DIR})
ENDIF(GETTEXT_INCLUDE_DIR)
FIND_LIBRARY(GETTEXT_LIBRARY gettextlib DOC "GetText library")
IF(APPLE OR WIN32)
FIND_LIBRARY(GETTEXT_INTL_LIBRARY intl DOC "GetText intl library")
ENDIF(APPLE OR WIN32)
IF(GETTEXT_LIBRARY)
SET(OTB_I18N 1)
SET(OTB_LANG $ENV{LANG} CACHE STRING "OTB internationalization (Experimental)")#might want to get the Locale from the system here
SET(OTB_LANG_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/I18n)
ADD_SUBDIRECTORY(I18n)
FIND_PATH(GETTEXT_INCLUDE_DIR
libintl.h
DOC "Path to gettext include directory (where libintl.h can be found)")
MARK_AS_ADVANCED(GETTEXT_INCLUDE_DIR)
IF(GETTEXT_INCLUDE_DIR)
INCLUDE_DIRECTORIES(${GETTEXT_INCLUDE_DIR})
ENDIF(GETTEXT_INCLUDE_DIR)
ENDIF(GETTEXT_LIBRARY)
ELSE(GETTEXT_FOUND)
SET(OTB_I18N 0)
MESSAGE(STATUS
......
......@@ -22,12 +22,12 @@ IF(OTB_USE_PQXX)
TARGET_LINK_LIBRARIES(OTBCommon pq pqxx)
ENDIF(OTB_USE_PQXX)
IF(GETTEXT_FOUND)
IF(OTB_I18N)
TARGET_LINK_LIBRARIES(OTBCommon ${GETTEXT_LIBRARY})
IF(APPLE OR WIN32)
TARGET_LINK_LIBRARIES(OTBCommon ${GETTEXT_INTL_LIBRARY})
ENDIF(APPLE OR WIN32)
ENDIF(GETTEXT_FOUND)
ENDIF(OTB_I18N)
IF(OTB_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(OTBCommon PROPERTIES ${OTB_LIBRARY_PROPERTIES})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment