diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-01-13 13:32:12 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-01-14 19:18:36 +0000 |
commit | 5b8fa72bdc81e10bce4ebc896f10853c73949276 (patch) | |
tree | df41b1ba98478d5aed83eb61667699d2f7dc739b /CMakeLists.txt | |
parent | 86fde7857f30d4fe1300047b5a12a8d656b46e7f (diff) |
CMake: Copy Qt DLLs to the target directory.
Add a "copy_qt_dlls" target similar to "copy_cli_dlls". Wireshark.exe
must exist before windeployqt can be run, so we can't create a PRE_BUILD
target. Add copy_qt_dlls to the default target instead.
Change-Id: If85d89478472b10b31229413465955fe98b0ef02
Reviewed-on: https://code.wireshark.org/review/6529
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c52c948e7e..7a64bcfc26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -534,6 +534,7 @@ if(BUILD_wireshark) set( WS_ALL_LIBS ${WS_ALL_LIBS} ${QT5_DLL_PATH} ) endif() set(PACKAGELIST ${PACKAGELIST} + Qt5Core Qt5LinguistTools Qt5MultimediaWidgets Qt5PrintSupport @@ -1414,6 +1415,29 @@ if(BUILD_wireshark AND QT_FOUND) $<TARGET_FILE_DIR:wireshark> ) endif() + + if(WIN32 AND Qt5Core_FOUND) + # Use windeployqt to copy our required DLLs to the run path. + # Ideally one of the modules in ${QTDIR}/lib/cmake/Qt5WinExtras + # would give us the path to windeployqt. For that matter a + # reliable path to qmake would be amazingly convenient. As it + # is we derive the location from Qt5::qmake, which is provided + # by Qt5Core. + get_target_property(_qmake_location Qt5::qmake IMPORTED_LOCATION) + get_filename_component(_qt_bindir "${_qmake_location}" DIRECTORY) + find_program(_windeployqt windeployqt PATHS "${_qmake_location}") + if (NOT "${_windeployqt}" STREQUAL "_windeployqt-NOTFOUND") + add_custom_target(copy_qt_dlls ALL) + # Will we ever need to use --debug? Windeployqt seems to + # be smart enough to copy debug DLLs when needed. + add_custom_command(TARGET copy_qt_dlls POST_BUILD + COMMAND "${_windeployqt}" + --release --no-compiler-runtime + "$<TARGET_FILE:wireshark>" + ) + add_dependencies(copy_qt_dlls wireshark) + endif() + endif(WIN32) endif() # Common properties for CLI executables |