summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-05-16 10:02:37 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-05-16 10:02:37 +0200
commita9ddb1242181032c549bcac7341e38cb2ee0bb73 (patch)
tree8b68c294b9a0ad0fad5d21e1957de9997c819997 /cmake
parent7b66bd9506ff7ef1fce0ebe0a4d4825b3899fcf3 (diff)
cmake: fix i18n target dependencies
The real error was on the "DEPENDS" like in boilerplate.cmake. The rest is merely removing dead code.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake5
-rw-r--r--cmake/opentrack-install.cmake15
2 files changed, 6 insertions, 14 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 6d83e49a..ec1946f0 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -110,18 +110,17 @@ function(otr_install_pdb_current_project target)
endfunction()
function(otr_i18n_for_target_directory n)
+ set(k "opentrack-${n}")
foreach(i ${opentrack-all-translations})
set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts")
- file(RELATIVE_PATH t "${CMAKE_SOURCE_DIR}" "${t}")
add_custom_command(OUTPUT "${t}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
COMMAND "${Qt5_DIR}/../../../bin/lupdate" -silent -recursive -no-obsolete -locations relative . -ts "${t}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
- DEPENDS ${${n}-cc} ${${n}-hh} ${${n}-ui} ${${n}-rc}
+ DEPENDS ${${k}-cc} ${${k}-hh} ${${k}-ui} ${${k}-rc}
COMMENT "Running lupdate for ${n}/${i}")
set(target-name "i18n-lang-${i}-module-${n}")
add_custom_target(${target-name} DEPENDS "${t}")
- set_property(GLOBAL APPEND PROPERTY "opentrack-ts-targets-${i}" "${target-name}")
set_property(GLOBAL APPEND PROPERTY "opentrack-ts-files-${i}" "${t}")
endforeach()
endfunction()
diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake
index e0d73d5f..2f91ab55 100644
--- a/cmake/opentrack-install.cmake
+++ b/cmake/opentrack-install.cmake
@@ -50,12 +50,10 @@ otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/AUTHORS.md")
function(merge_translations)
install(CODE "file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/i18n\")")
- set(all-ts-files "")
set(all-qm-files "")
foreach(i ${opentrack-all-translations})
get_property(ts-files GLOBAL PROPERTY "opentrack-ts-files-${i}")
- #get_property(ts-deps GLOBAL PROPERTY "opentrack-ts-targets-${i}")
set(ts-files_ "")
@@ -67,25 +65,20 @@ function(merge_translations)
set(ts-files "${ts-files_}")
- foreach(k ${ts-files})
- list(APPEND all-ts-files "${k}")
- endforeach()
-
if(NOT ".${ts-files}" STREQUAL ".")
- set(lrelease-deps "${ts-files}")
-
set(qm-output "${CMAKE_CURRENT_BINARY_DIR}/${i}.qm")
list(APPEND all-qm-files "${qm-output}")
add_custom_command(OUTPUT "${qm-output}"
COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts-files} -qm "${qm-output}"
- DEPENDS ${lrelease-deps}
- COMMENT "Running lrelease for ${i}")
+ DEPENDS ${ts-files}
+ COMMENT "Running lrelease for ${i}"
+ )
set(lang-target "i18n-lang-${i}")
+ add_custom_target("${lang-target}" DEPENDS "${qm-output}")
install(FILES "${qm-output}" DESTINATION "${opentrack-i18n-pfx}" RENAME "${i}.qm" ${opentrack-perms})
endif()
endforeach()
add_custom_target(i18n ALL DEPENDS ${all-qm-files})
- add_custom_target(force-i18n DEPENDS ${all-ts-files} ${all-qm-files} i18n)
endfunction()