From 8d26343af849f3d2ab2e6e032fcf8161c496f76e Mon Sep 17 00:00:00 2001 From: Tobias Ellinghaus Date: Tue, 10 Feb 2015 11:31:32 +0100 Subject: [PATCH] Try to get rid of explicit Gettext dependency We are using Gettext via glib, no need to depend on it from CMake. Let's see if this breaks for some systems. --- CMakeLists.txt | 31 +++++++++++------------- cmake/modules/FindGettext.cmake | 42 --------------------------------- src/CMakeLists.txt | 11 ++------- src/cli/main.c | 1 - 4 files changed, 16 insertions(+), 69 deletions(-) delete mode 100644 cmake/modules/FindGettext.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f4bc6677dec..1cc0daf8a8b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,24 +204,21 @@ endif(NOT EXTERNAL_PROGRAMS_FOUND) #need to put here do setting LOCALE_DIR variable if(USE_NLS) -find_package(Gettext) -if(Gettext_FOUND) - if(NOT LOCALE_DIR) + if(NOT LOCALE_DIR) SET(LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/share/locale") - endif(NOT LOCALE_DIR) - - if(NOT LOCALE_DIR) - message(QUIET "Set LOCALE_DIR to path to get Gettext working") - else() - find_package(Msgfmt) - if(Msgfmt_FOUND) - message(STATUS "Found msgfmt to convert language file. Translation enabled") - add_subdirectory(po) - else() - message(STATUS "Cannot find msgfmt to convert language file. Translation won't be enabled") - endif() - endif(NOT LOCALE_DIR) -endif(Gettext_FOUND) + endif(NOT LOCALE_DIR) + + if(NOT LOCALE_DIR) + message(QUIET "Set LOCALE_DIR to path to get Gettext working") + else() + find_package(Msgfmt) + if(Msgfmt_FOUND) + message(STATUS "Found msgfmt to convert language file. Translation enabled") + add_subdirectory(po) + else() + message(STATUS "Cannot find msgfmt to convert language file. Translation won't be enabled") + endif() + endif(NOT LOCALE_DIR) endif(USE_NLS) if(NOT DEFINED RUNTIME_LOCALE_DIR) diff --git a/cmake/modules/FindGettext.cmake b/cmake/modules/FindGettext.cmake deleted file mode 100644 index f3029a2297c0..000000000000 --- a/cmake/modules/FindGettext.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# - Try to find Gettext -# Once done, this will define -# -# Gettext_FOUND - system has Gettext -# Gettext_INCLUDE_DIRS - the Gettext include directories -# Gettext_LIBRARIES - link these to use Gettext -# -# See documentation on how to write CMake scripts at -# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries - -include(LibFindMacros) - -# On Linux there is no pkgconfig script, but with this we force Gettext_PKGCONF_INCLUDE_DIRS to "" -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(Gettext_PKGCONF_INCLUDE_DIRS "") -else(CMAKE_SYSTEM_NAME STREQUAL "Linux") - libfind_pkg_check_modules(Gettext_PKGCONF Gettext) -endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - -if(WIN32 OR APPLE) - set(Gettext_LIBRARY_SEARCH_DIRS - /opt/local/lib - /sw/local/lib - ) - - find_library(Gettext_LIBRARY - NAMES intl - PATHS ${Gettext_LIBRARY_SEARCH_DIRS} - HINTS ${Gettext_PKGCONF_LIBRARY_DIRS} - ) - - set(Gettext_PROCESS_LIBS Gettext_LIBRARY) -endif() - -find_path(Gettext_INCLUDE_DIR - NAMES libintl.h - HINTS ${Gettext_PKGCONF_INCLUDE_DIRS} - PATHS /opt/local/include -) - -set(Gettext_PROCESS_INCLUDES Gettext_INCLUDE_DIR) -libfind_process(Gettext) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aca2ee2d135a..65ef1856fcac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -186,15 +186,8 @@ foreach(lib ${OUR_LIBS} LensFun GIO GThread GModule PangoCairo PThread Rsvg2 Lib endforeach(lib) if(USE_NLS) - find_package(Gettext) - if(Gettext_FOUND) - include_directories(SYSTEM ${Gettext_INCLUDE_DIRS}) - list(APPEND LIBS ${Gettext_LIBRARIES}) - add_definitions("-DUSE_GETTEXT") - message(STATUS "Internationalization: Enabled") - else() - message(STATUS "Internationalization: Disabled (libintl not found)") - endif() + add_definitions("-DUSE_GETTEXT") + message(STATUS "Internationalization: Enabled") endif(USE_NLS) if(USE_FLICKR) diff --git a/src/cli/main.c b/src/cli/main.c index cdda63eb6027..5c3f7fcd6aa4 100644 --- a/src/cli/main.c +++ b/src/cli/main.c @@ -43,7 +43,6 @@ #include #include #include -#include static void generate_thumbnail_cache() {