mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
build-system: fix failing installer builds
Both for Windows and macOS the installers actually didn't work correctly. It turns out that the nifty trick (which is the officially documented way of doing this) for setting up Qt5 OR Qt6 doesn't actually set up all of the variables correctly - at least not on Windows and macOS. Instead of trying to figure out why that part is failing, I decided to simply immediately re-run the find_package for Qt5 if we don't find Qt6. In the Windows case there was an additional problem: A very subtle typo where a Qt5 turned into a Qt (which alone would have broken things). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b4e56ebef1
commit
a363ad0910
1 changed files with 10 additions and 2 deletions
|
@ -174,7 +174,11 @@ include_directories(.
|
||||||
)
|
)
|
||||||
|
|
||||||
# figure out which version of Qt we are building against
|
# figure out which version of Qt we are building against
|
||||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
|
# in theory this should get us all the variables set up correctly, but that
|
||||||
|
# ended up failing in subtle ways to do what was advertized; in the Qt5 case
|
||||||
|
# some of the variables didn't get set up, so we'll immediately call it again
|
||||||
|
# for Qt5
|
||||||
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Widgets)
|
||||||
|
|
||||||
# right now there are a few things that don't work with Qt6
|
# right now there are a few things that don't work with Qt6
|
||||||
# let's disable them right here and remember our Qt version
|
# let's disable them right here and remember our Qt version
|
||||||
|
@ -189,9 +193,13 @@ if(QT_VERSION_MAJOR STREQUAL "6")
|
||||||
set(NO_PRINTING ON)
|
set(NO_PRINTING ON)
|
||||||
set(NO_USERMANUAL ON)
|
set(NO_USERMANUAL ON)
|
||||||
else()
|
else()
|
||||||
|
# as mentioned above, since some variables appear to fail to populate
|
||||||
|
# on some platforms, simply run this again the 'old' way
|
||||||
|
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
|
||||||
set(USINGQT6 OFF)
|
set(USINGQT6 OFF)
|
||||||
set(QT5OR6 "5")
|
set(QT5OR6 "5")
|
||||||
set(QT_VERSION ${Qt5_VERSION})
|
set(QT_VERSION ${Qt5_VERSION})
|
||||||
|
set(QT_INSTALL_PREFIX ${_qt5Core_install_prefix})
|
||||||
# for Qt5 we want the Location component (which is missing so far in Qt6)
|
# for Qt5 we want the Location component (which is missing so far in Qt6)
|
||||||
LIST(APPEND QT_EXTRA_COMPONENTS Location)
|
LIST(APPEND QT_EXTRA_COMPONENTS Location)
|
||||||
endif()
|
endif()
|
||||||
|
@ -613,7 +621,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
if(NOT QT_VERSION VERSION_LESS 5.11.0)
|
if(NOT QT_VERSION VERSION_LESS 5.11.0)
|
||||||
# hack to work around the fact that we don't process the dependencies of plugins
|
# hack to work around the fact that we don't process the dependencies of plugins
|
||||||
# as of Qt 5.11 this additional DLL is needed and it's only referenced in the qml DLLs
|
# as of Qt 5.11 this additional DLL is needed and it's only referenced in the qml DLLs
|
||||||
install(FILES ${QT_INSTALL_PREFIX}/bin/QtPositioningQuick.dll DESTINATION ${WINDOWSSTAGING})
|
install(FILES ${QT_INSTALL_PREFIX}/bin/Qt5PositioningQuick.dll DESTINATION ${WINDOWSSTAGING})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT DEFINED MAKENSIS)
|
if(NOT DEFINED MAKENSIS)
|
||||||
|
|
Loading…
Reference in a new issue