From 430999e399a5321e97e28ebc6eccc6bc46c618fe Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 13 Mar 2022 16:15:32 +0100 Subject: utils: Work around windeployqt bug. For Qt versions less than 5.14 MinGW windeployqt requires passing --release or --debug to pick the correct libs to deploy. For newer version this must not be passed, or otherwise windeployqt errors out. Use a conditional expression to only add the parameter for older Qt versions. Change-Id: I7afe2b77e9829e989adaeeb7c7499d5955926da2 --- utils/cmake/deploy.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'utils/cmake/deploy.cmake') diff --git a/utils/cmake/deploy.cmake b/utils/cmake/deploy.cmake index f1430f0dee..252aba0636 100644 --- a/utils/cmake/deploy.cmake +++ b/utils/cmake/deploy.cmake @@ -104,7 +104,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") endif() set(DMGBUILD ${CMAKE_BINARY_DIR}/venv/bin/python3 -m dmgbuild) set(DMGBUILD_STAMP ${CMAKE_BINARY_DIR}/dmgbuild.stamp) - find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${qtbindir}") + find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QTBINDIR}") # need extra rules so we can use generator expressions # (using get_target_property() doesn't know neede values during generation) @@ -160,7 +160,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") message(WARNING "Deploying a Debug build.") endif() - find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${qtbindir}") + find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QTBINDIR}") set(deploydir ${CMAKE_BINARY_DIR}/deploy-${deploy_TARGET}) if(WINDEPLOYQT_EXECUTABLE) add_custom_command( @@ -169,7 +169,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") COMMAND ${CMAKE_COMMAND} -E make_directory ${deploydir} COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${deploydir} COMMAND ${WINDEPLOYQT_EXECUTABLE} - $,--debug,--release> # on MinGW, release is mistaken as debug. + # on MinGW, release is mistaken as debug for Qt less than 5.14. + # For later versions the opposite is true: adding --debug or + # --release will fail with "platform plugin not found." + $,$,--debug,--release>,> ${deploydir}/$ DEPENDS ${deploy_TARGET} ) -- cgit v1.2.3