Qt4: Only change timestamp on generated .pro files if content changes

In qt4_create_translation() use file(GENERATE ...) instead of
file(WRITE ...).  This also removes a possible CMP0058 warning
because file(GENERATE) tells the Ninja generator about the files
it provides.

Fixes: #16518
This commit is contained in:
Clinton Stimpson 2017-01-17 07:57:09 -07:00 committed by Brad King
parent 35ad12f99e
commit 1c2ac0b8ba

View File

@ -439,7 +439,7 @@ macro(QT4_CREATE_TRANSLATION _qm_files)
get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
string(APPEND _pro_includes " \\\n \"${_abs_include}\"")
endforeach()
file(WRITE ${_ts_pro} "SOURCES =${_pro_srcs}\nINCLUDEPATH =${_pro_includes}\n")
file(GENERATE OUTPUT ${_ts_pro} CONTENT "SOURCES =${_pro_srcs}\nINCLUDEPATH =${_pro_includes}\n")
endif()
add_custom_command(OUTPUT ${_ts_file}
COMMAND Qt4::lupdate