Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Use qtpaths -query over qmake -query when possible #965

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cmake/KDAB/modules/KDQtInstallPaths.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ if(NOT DEFINED QT_VERSION_MAJOR)
message(FATAL_ERROR "Please set QT_VERSION_MAJOR first (ie. set(QT_VERSION_MAJOR 5))")
endif()

if(TARGET Qt${QT_VERSION_MAJOR}::qmake)
get_target_property(QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake LOCATION)
# can use qtpaths to find version instead of qmake
# but cmake target Qt5::qtpaths DNE, so use qtpaths for 6 only
if (QT_VERSION_MAJOR EQUAL 6)
set(findqt qtpaths)
else()
set(findqt qmake)
endif()

if(TARGET Qt${QT_VERSION_MAJOR}::${findqt})
mattkdab marked this conversation as resolved.
Show resolved Hide resolved
get_target_property(QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::${findqt} LOCATION)
else()
message(FATAL_ERROR "No supported Qt version found. Make sure you find Qt before calling this")
endif()
Expand Down