diff options
author | Julian Andres Klode <jak@debian.org> | 2016-08-23 18:48:43 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-08-26 19:50:57 +0200 |
commit | cede4eda68220a002822194605d436b7ca044afa (patch) | |
tree | 299fed79a722a4babb8ec56bf904cedbd8bf5da7 | |
parent | 24ad9b325f2d277864e3a75931137b93dd75cd03 (diff) |
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
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 9 insertions, 3 deletions
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) |