From cede4eda68220a002822194605d436b7ca044afa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 18:48:43 +0200 Subject: CMake: Add support for libintl 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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b2e5bfe9c..189a8d570 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) -- cgit v1.2.3