[cmake] actually use libintil headers/libraries if detected

Closes #4663.
This commit is contained in:
David Adam 2018-01-17 07:49:54 +08:00
parent 42fa841573
commit b6202c3c86
2 changed files with 4 additions and 2 deletions

View file

@ -103,7 +103,7 @@ ADD_LIBRARY(fishlib STATIC ${FISH_SRCS})
TARGET_SOURCES(fishlib PRIVATE ${FISH_HEADERS}) TARGET_SOURCES(fishlib PRIVATE ${FISH_HEADERS})
TARGET_LINK_LIBRARIES(fishlib TARGET_LINK_LIBRARIES(fishlib
${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS} ${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS}
${PCRE2_LIB} muparser) ${PCRE2_LIB} muparser ${Intl_LIBRARIES})
# Define fish. # Define fish.
ADD_EXECUTABLE(fish src/fish.cpp) ADD_EXECUTABLE(fish src/fish.cpp)

View file

@ -8,6 +8,7 @@ IF(WITH_GETTEXT)
FIND_PACKAGE(Gettext) FIND_PACKAGE(Gettext)
IF(GETTEXT_FOUND) IF(GETTEXT_FOUND)
SET(HAVE_GETTEXT 1) SET(HAVE_GETTEXT 1)
INCLUDE_DIRECTORIES(${Intl_INCLUDE_DIR})
ENDIF() ENDIF()
ENDIF() ENDIF()
ADD_FEATURE_INFO(gettext GETTEXT_FOUND "translate messages with gettext") ADD_FEATURE_INFO(gettext GETTEXT_FOUND "translate messages with gettext")
@ -25,7 +26,8 @@ ENDIF()
# libintl.h can be compiled into the stdlib on some GLibC systems # libintl.h can be compiled into the stdlib on some GLibC systems
IF(Intl_FOUND AND Intl_LIBRARIES) IF(Intl_FOUND AND Intl_LIBRARIES)
SET(LIBINTL_INCLUDE "#include <libintl.h>") SET(LIBINTL_INCLUDE "#include <libintl.h>")
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} intl) SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${Intl_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Intl_LIBRARIES})
ENDIF() ENDIF()
CHECK_CXX_SOURCE_COMPILES(" CHECK_CXX_SOURCE_COMPILES("
${LIBINTL_INCLUDE} ${LIBINTL_INCLUDE}