-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/translations DESTINATION ${CMAKE_SOURCE_DIR}/resources) | ||
function(setup_translations target) | ||
if (DEFINED ENV{ECLIPSE_TRANSLATIONS_REPO_PATH}) | ||
set(TRANSLATIONS_PATH $ENV{ECLIPSE_TRANSLATIONS_REPO_PATH}) | ||
else() | ||
set(TRANSLATIONS_PATH ${CMAKE_CURRENT_BINARY_DIR}/eclipse-translations) | ||
endif() | ||
|
||
# Refresh translations on every build | ||
add_custom_command( | ||
TARGET ${target} POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
${TRANSLATIONS_PATH}/translations | ||
${CMAKE_SOURCE_DIR}/resources/translations | ||
COMMENT "Copying translations..." | ||
) | ||
|
||
# If using a local repo, set timestamp to a high value to disable translations updates | ||
if (DEFINED ENV{ECLIPSE_TRANSLATIONS_REPO_PATH}) | ||
set(TRANSLATIONS_UNIX_TIMESTAMP 9999999999) | ||
else() | ||
string(TIMESTAMP TRANSLATIONS_UNIX_TIMESTAMP "%s" UTC) | ||
endif() | ||
|
||
target_compile_definitions(${target} PRIVATE ECLIPSE_TRANSLATION_TIMESTAMP=${TRANSLATIONS_UNIX_TIMESTAMP}) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters