]> git.saurik.com Git - apt.git/commitdiff
CMake: Add support for libintl
authorJulian Andres Klode <jak@debian.org>
Tue, 23 Aug 2016 16:48:43 +0000 (18:48 +0200)
committerJulian Andres Klode <jak@debian.org>
Fri, 26 Aug 2016 17:50:57 +0000 (19:50 +0200)
This basically just links everything to libintl if USE_NLS is
on. It would be better to just link those targets that are
actually translated, but doing so is a huge PITA.

Also move the include_directories() for the build-tree include/
directory to the top of the CMakeLists.txt, otherwise it only
gets passed after Intl_INCLUDE_DIRS, which means we will built
against installed apt-pkg headers (if any) instead of our own.

Gbp-Dch: ignore

CMakeLists.txt

index b2e5bfe9ce4613164f7b1a37fc1f25e589930dd3..189a8d57047ef302be9de7a7bf73a93bc60ab316 100644 (file)
@@ -4,6 +4,9 @@
 # set minimum version
 project(apt)
 cmake_minimum_required(VERSION 3.4.0)
+# Generic header locations
+include_directories(${PROJECT_BINARY_DIR}/include)
+
 
 enable_testing()
 
@@ -27,6 +30,12 @@ include(TestBigEndian)
 find_package(Threads)
 find_package(LFS REQUIRED)
 
+if(USE_NLS)
+  find_package(Intl REQUIRED)
+  link_libraries(${Intl_LIBRARIES})
+  include_directories(${Intl_INCLUDE_DIRS})
+endif()
+
 # Add large file support
 add_compile_options(${LFS_COMPILE_OPTIONS})
 add_definitions(${LFS_DEFINITIONS})
@@ -166,9 +175,6 @@ endif()
 configure_file(CMake/config.h.in ${PROJECT_BINARY_DIR}/include/config.h)
 configure_file(CMake/apti18n.h.in ${PROJECT_BINARY_DIR}/include/apti18n.h)
 
-# Generic header locations
-include_directories(${PROJECT_BINARY_DIR}/include)
-
 # Add our subdirectories
 add_subdirectory(vendor)
 add_subdirectory(apt-pkg)