mirror of
https://github.com/monero-project/monero.git
synced 2026-07-28 14:47:15 -07:00
cmake: add build translations option
This commit is contained in:
+5
-1
@@ -410,6 +410,7 @@ endif()
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
enable_testing()
|
||||
|
||||
option(BUILD_TRANSLATIONS "Build translations using lrelease (Qt)" OFF)
|
||||
option(BUILD_DOCUMENTATION "Build the Doxygen documentation." ON)
|
||||
option(BUILD_TESTS "Build tests." OFF)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
@@ -632,8 +633,9 @@ function (monero_add_library_with_deps)
|
||||
PRIVATE $<TARGET_PROPERTY:${MONERO_ADD_LIBRARY_NAME},INTERFACE_COMPILE_DEFINITIONS>)
|
||||
endfunction ()
|
||||
|
||||
if(BUILD_TRANSLATIONS)
|
||||
# Generate header for embedded translations
|
||||
# Generate header for embedded translations, use target toolchain if depends, otherwise use the
|
||||
# use target toolchain if depends, otherwise use the
|
||||
# lrelease and lupdate binaries from the host
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(generate_translations_header
|
||||
@@ -643,6 +645,8 @@ ExternalProject_Add(generate_translations_header
|
||||
CMAKE_ARGS -DLRELEASE_PATH=${LRELEASE_PATH}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "")
|
||||
include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations")
|
||||
endif()
|
||||
|
||||
add_subdirectory(external)
|
||||
|
||||
# Final setup for libunbound
|
||||
|
||||
@@ -61,8 +61,12 @@ monero_private_headers(common
|
||||
monero_add_library(common
|
||||
${common_sources}
|
||||
${common_headers}
|
||||
${common_private_headers}
|
||||
DEPENDS generate_translations_header)
|
||||
${common_private_headers})
|
||||
|
||||
if(BUILD_TRANSLATIONS)
|
||||
add_dependencies(obj_common generate_translations_header)
|
||||
endif()
|
||||
|
||||
target_link_libraries(common
|
||||
PUBLIC
|
||||
cncrypto
|
||||
|
||||
@@ -33,7 +33,14 @@
|
||||
#include <map>
|
||||
#include "file_io_utils.h"
|
||||
#include "common/i18n.h"
|
||||
|
||||
#if __has_include("translation_files.h")
|
||||
#include "translation_files.h"
|
||||
#else
|
||||
static bool find_embedded_file(const std::string &name, std::string &data) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
Reference in New Issue
Block a user