CMake+Qt: Only copy our translation files on Windows

Copying to the macOS application bundle breaks code signing on that
platform:

    Wireshark.app/Contents/MacOS/Wireshark: code object is not signed at all
    In subcomponent: /path/to/wireshark/wireshark/build/run/Wireshark.app/Contents/MacOS/translations/wireshark_zh_CN.qm
This commit is contained in:
Gerald Combs 2023-05-31 11:35:21 -07:00
parent 0041ab5256
commit 507330fbc6
1 changed files with 8 additions and 6 deletions

View File

@ -712,12 +712,14 @@ else()
QT5_ADD_TRANSLATION(WIRESHARK_QT_QM ${WIRESHARK_QT_TS})
endif()
add_custom_target(copy_qt_translations ALL)
add_custom_command(TARGET copy_qt_translations
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:wireshark>/translations
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${WIRESHARK_QT_QM} $<TARGET_FILE_DIR:wireshark>/translations
)
if (WIN32)
add_custom_target(copy_qt_translations ALL)
add_custom_command(TARGET copy_qt_translations
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:wireshark>/translations
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${WIRESHARK_QT_QM} $<TARGET_FILE_DIR:wireshark>/translations
)
endif()
add_custom_target(
translations