Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix translations header generation when cross-compilating #3062

Merged
merged 1 commit into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this bit with echo do ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build failed when INSTALL_COMMAND was not set or set to an empty string as apparently ExternalProject requires an install step even if in this case there is nothing to install.

So as a workaround I set INSTALL_COMMAND to a command doing nothing that should be available on all architectures (printing an empty message using cmake).

include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations")

add_subdirectory(external)
Expand Down
2 changes: 2 additions & 0 deletions translations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down