summaryrefslogtreecommitdiff
path: root/net-misc/seafile-client/files/seafile-client-8.0.6-select-qt5.patch
blob: 4d3a3d17264445c7dbfeb7fa045c37e96f05ab55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c4a4447..5747df46 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -133,14 +133,12 @@ ENDIF()
 ####################
 ###### BEGIN: QT configuration
 ####################
-FIND_PROGRAM(qmake_executable NAMES qmake qmake.exe)
-EXECUTE_PROCESS(COMMAND
-    bash -c "${qmake_executable} --version | grep -iE '^using qt version [0-9.]+' | awk '{print $4}'"
-    OUTPUT_VARIABLE DETECTED_QT_VERSION
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
+FIND_PACKAGE(Qt5Core)
+SET(DETECTED_QT_VERSION ${Qt5Core_VERSION})
 MESSAGE("Qt version: ${DETECTED_QT_VERSION}")
+GET_TARGET_PROPERTY(QMAKE_EXECUTABLE_PATH Qt5::qmake IMPORTED_LOCATION)
 EXECUTE_PROCESS(COMMAND
-    bash -c "qmake --version|grep -iE '^using qt version [0-9]'|awk '{print $4}'|grep -iE '^[0-9]'|awk -F . '{print $1}'"
+    bash -c "${QMAKE_EXECUTABLE_PATH} --version|grep -iE '^using qt version [0-9]'|awk '{print $4}'|grep -iE '^[0-9]'|awk -F . '{print $1}'"
     OUTPUT_VARIABLE QT_VERSION_MAJOR
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 MESSAGE("QT_VERSION_MAJOR: ${QT_VERSION_MAJOR}")