Lines 68-73
Link Here
|
68 |
if(NOT EXISTS "${stamp_file_dir}") |
68 |
if(NOT EXISTS "${stamp_file_dir}") |
69 |
file(MAKE_DIRECTORY "${stamp_file_dir}") |
69 |
file(MAKE_DIRECTORY "${stamp_file_dir}") |
70 |
endif() |
70 |
endif() |
|
|
71 |
set(stamp_files "") |
71 |
foreach(_ts_file ${_my_tsfiles}) |
72 |
foreach(_ts_file ${_my_tsfiles}) |
72 |
get_filename_component(_ts_name ${_ts_file} NAME) |
73 |
get_filename_component(_ts_name ${_ts_file} NAME) |
73 |
if(_my_sources) |
74 |
if(_my_sources) |
Lines 95-101
Link Here
|
95 |
|
96 |
|
96 |
file(WRITE ${_ts_lst_file} "${_lst_file_srcs}") |
97 |
file(WRITE ${_ts_lst_file} "${_lst_file_srcs}") |
97 |
endif() |
98 |
endif() |
98 |
set(stamp_file "${stamp_file_dir}/${_ts_name}.stamp") |
99 |
file(RELATIVE_PATH _ts_relative_path ${CMAKE_CURRENT_SOURCE_DIR} ${_ts_file}) |
|
|
100 |
string(REPLACE "../" "__/" _ts_relative_path "${_ts_relative_path}") |
101 |
set(stamp_file "${stamp_file_dir}/${_ts_relative_path}.stamp") |
102 |
list(APPEND stamp_files ${stamp_file}) |
103 |
get_filename_component(full_stamp_file_dir "${stamp_file}" DIRECTORY) |
104 |
if(NOT EXISTS "${full_stamp_file_dir}") |
105 |
file(MAKE_DIRECTORY "${full_stamp_file_dir}") |
106 |
endif() |
99 |
add_custom_command(OUTPUT ${stamp_file} |
107 |
add_custom_command(OUTPUT ${stamp_file} |
100 |
COMMAND ${Qt5_LUPDATE_EXECUTABLE} |
108 |
COMMAND ${Qt5_LUPDATE_EXECUTABLE} |
101 |
ARGS ${_lupdate_options} "@${_ts_lst_file}" -ts ${_ts_file} |
109 |
ARGS ${_lupdate_options} "@${_ts_lst_file}" -ts ${_ts_file} |
Lines 103-109
Link Here
|
103 |
DEPENDS ${_dependencies} |
111 |
DEPENDS ${_dependencies} |
104 |
VERBATIM) |
112 |
VERBATIM) |
105 |
endforeach() |
113 |
endforeach() |
106 |
qt5_add_translation(${_qm_files} __QT_INTERNAL_DEPEND_ON_TIMESTAMP_FILE ${_my_tsfiles}) |
114 |
qt5_add_translation(${_qm_files} ${_my_tsfiles} __QT_INTERNAL_TIMESTAMP_FILES ${stamp_files}) |
107 |
set(${_qm_files} ${${_qm_files}} PARENT_SCOPE) |
115 |
set(${_qm_files} ${${_qm_files}} PARENT_SCOPE) |
108 |
endfunction() |
116 |
endfunction() |
109 |
|
117 |
|
Lines 120-136
Link Here
|
120 |
|
128 |
|
121 |
|
129 |
|
122 |
function(QT5_ADD_TRANSLATION _qm_files) |
130 |
function(QT5_ADD_TRANSLATION _qm_files) |
123 |
set(options __QT_INTERNAL_DEPEND_ON_TIMESTAMP_FILE) |
131 |
set(options) |
124 |
set(oneValueArgs) |
132 |
set(oneValueArgs) |
125 |
set(multiValueArgs OPTIONS) |
133 |
set(multiValueArgs OPTIONS __QT_INTERNAL_TIMESTAMP_FILES) |
126 |
|
134 |
|
127 |
cmake_parse_arguments(_LRELEASE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) |
135 |
cmake_parse_arguments(_LRELEASE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) |
128 |
set(_lrelease_files ${_LRELEASE_UNPARSED_ARGUMENTS}) |
136 |
set(_lrelease_files ${_LRELEASE_UNPARSED_ARGUMENTS}) |
129 |
|
137 |
|
|
|
138 |
set(idx 0) |
130 |
foreach(_current_FILE ${_lrelease_files}) |
139 |
foreach(_current_FILE ${_lrelease_files}) |
131 |
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) |
140 |
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) |
132 |
get_filename_component(qm ${_abs_FILE} NAME) |
141 |
get_filename_component(qm ${_abs_FILE} NAME) |
133 |
set(ts_stamp_file "${CMAKE_CURRENT_BINARY_DIR}/.lupdate/${qm}.stamp") |
|
|
134 |
# everything before the last dot has to be considered the file name (including other dots) |
142 |
# everything before the last dot has to be considered the file name (including other dots) |
135 |
string(REGEX REPLACE "\\.[^.]*$" "" FILE_NAME ${qm}) |
143 |
string(REGEX REPLACE "\\.[^.]*$" "" FILE_NAME ${qm}) |
136 |
get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION) |
144 |
get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION) |
Lines 141-147
Link Here
|
141 |
set(qm "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.qm") |
149 |
set(qm "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.qm") |
142 |
endif() |
150 |
endif() |
143 |
|
151 |
|
144 |
if(_LRELEASE___QT_INTERNAL_DEPEND_ON_TIMESTAMP_FILE) |
152 |
if(_LRELEASE___QT_INTERNAL_TIMESTAMP_FILES) |
|
|
153 |
list(GET _LRELEASE___QT_INTERNAL_TIMESTAMP_FILES ${idx} ts_stamp_file) |
154 |
math(EXPR idx "${idx} + 1") |
145 |
set(qm_dep "${ts_stamp_file}") |
155 |
set(qm_dep "${ts_stamp_file}") |
146 |
else() |
156 |
else() |
147 |
set(qm_dep "${_abs_FILE}") |
157 |
set(qm_dep "${_abs_FILE}") |