From f035478d357d066ed18e2667c1edc6ff9dfe384b Mon Sep 17 00:00:00 2001 From: Guillaume LE VAILLANT Date: Thu, 4 Jan 2018 11:26:29 +0100 Subject: [PATCH] Fix translations header generation when cross-compilating Define generate_translations_header as an external project to be able to use the compilation toolchain for the host instead of the toolchain for the target. --- CMakeLists.txt | 6 +++++- translations/CMakeLists.txt | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d451f8ad..5d63f1172 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -366,7 +366,11 @@ endif() add_definitions(-DAUTO_INITIALIZE_EASYLOGGINGPP) # Generate header for embedded translations -add_subdirectory(translations) +include(ExternalProject) +ExternalProject_Add(generate_translations_header + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/translations" + BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/translations" + INSTALL_COMMAND cmake -E echo "") include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations") add_subdirectory(external) diff --git a/translations/CMakeLists.txt b/translations/CMakeLists.txt index 36b72d68a..f74e63c76 100644 --- a/translations/CMakeLists.txt +++ b/translations/CMakeLists.txt @@ -28,6 +28,8 @@ cmake_minimum_required(VERSION 2.8.7) +project(translations) + add_executable(generate_translations_header generate_translations_header.c) find_program(LRELEASE lrelease)