Skip to content

Commit

Permalink
Make Qt5Script really optional (#1029)
Browse files Browse the repository at this point in the history
Commit b7a776d hard-enabled WITH_QTSCRIPT
again for unknown reasons.

The way find_package was used, it was not actually possible to disable
Qt5Script via cmake switch.

Signed-off-by: Andreas Sturmlechner <[email protected]>
  • Loading branch information
a17r authored Oct 22, 2023
1 parent 98da9d5 commit 8a18055
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,11 @@ if (QT_DEFAULT_MAJOR_VERSION EQUAL 6)
set(QT_VERSION_PATCH "${Qt6_VERSION_PATCH}")
else ()
# Check for Qt5
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui UiTools Concurrent Xml LinguistTools Qml OPTIONAL_COMPONENTS Script ScriptTools)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui UiTools Concurrent Xml LinguistTools Qml)
set(QT_LIBRARIES Qt5::Core Qt5::Widgets Qt5::Gui Qt5::UiTools Qt5::Concurrent Qt5::Xml Qt5::Qml)

find_package(Qt5Script)
find_package(Qt5ScriptTools)
if (Qt5Script_FOUND AND Qt5ScriptTools_FOUND)
list(APPEND QT_LIBRARIES Qt5::ScriptTools Qt5::Script)
set(WITH_QTSCRIPT ON)
Expand Down Expand Up @@ -316,7 +318,6 @@ else ()
set(QT_VERSION_MAJOR "${Qt5_VERSION_MAJOR}")
set(QT_VERSION_MINOR "${Qt5_VERSION_MINOR}")
set(QT_VERSION_PATCH "${Qt5_VERSION_PATCH}")
set(WITH_QTSCRIPT ON)
endif ()

# Expose the major version number of Qt to the preprocessor. This is necessary
Expand Down

0 comments on commit 8a18055

Please sign in to comment.