Skip to content

Commit 031acd0

Browse files
committed
Fix search path for qmlplugindump tool
CMake kept picking up the binary from /usr/bin which belongs to Qt4 installation. Here we require CMake to use the binary from Qt5 installation that is being used.
1 parent 8fbae38 commit 031acd0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cmake/FindQtQmlTools.cmake

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Qt QML Tools
22
# ~~~~~~~~~~~~
3-
#
3+
#
44
# To generate qmltypes files required by Qt Creator to allow QML code inspection
55
# (http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html#generating-qmltypes-files)
66
# we need to have installed qmlplugindump unity (shipped with Qt 4.8 and later)
77
# http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html#dumping-plugins-automatically
88
#
9-
# Find the installed version of qmlplugindump utility.
9+
# Find the installed version of qmlplugindump utility.
1010
# FindQtQmlTools should be called after Qt5 has been found
1111
#
1212
# This file defines the following variables:
@@ -15,20 +15,22 @@
1515
# QMLPLUGINDUMP_EXECUTABLE - Path to qmlplugindump executable
1616
#
1717
# Also defines MACRO to create qmltypes file, when QML directory is supplied
18-
#
18+
#
1919
# Copyright (c) 2017, Peter Petrik <zilolv at gmail dot com>
2020
# Redistribution and use is allowed according to the terms of the BSD license.
2121
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
2222

2323
MACRO(FIND_QMLPLUGINDUMP)
24+
get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
25+
2426
IF(NOT QMLPLUGINDUMP_EXECUTABLE)
2527
IF (MSVC)
26-
FIND_PROGRAM(QMLPLUGINDUMP_EXECUTABLE qmlplugindump.exe)
28+
FIND_PROGRAM(QMLPLUGINDUMP_EXECUTABLE qmlplugindump.exe PATHS ${QT_BIN_DIR} NO_DEFAULT_PATH)
2729
ELSE (MSVC)
28-
FIND_PROGRAM(QMLPLUGINDUMP_EXECUTABLE qmlplugindump)
30+
FIND_PROGRAM(QMLPLUGINDUMP_EXECUTABLE qmlplugindump PATHS ${QT_BIN_DIR} NO_DEFAULT_PATH)
2931
ENDIF (MSVC)
3032
ENDIF(NOT QMLPLUGINDUMP_EXECUTABLE)
31-
33+
3234
IF (QMLPLUGINDUMP_EXECUTABLE)
3335
SET(QMLPLUGINDUMP_FOUND TRUE)
3436
MESSAGE(STATUS "Found qmlplugindump: ${QMLPLUGINDUMP_EXECUTABLE}")

0 commit comments

Comments
 (0)