Skip to content

Commit 0ad5290

Browse files
committed
cmake: do not use Qt5Widgets when locating QtSingleApplication. Closes qbittorrent#7551.
This fixes cmake builds with GUI disabled and system QtSingleApplication. We rely on Qt5::Core instead of Qt5::Widgets.
1 parent 7895afb commit 0ad5290

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

cmake/Modules/FindQtSingleApplication.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ IF(QT4_FOUND)
3030
NAMES ${QTSINGLEAPPLICATION_NAMES}
3131
PATHS ${QT_LIBRARY_DIR}
3232
)
33-
ELSEIF(Qt5Widgets_FOUND)
33+
ELSEIF(Qt5Core_FOUND)
3434
message(STATUS "Looking for Qt5 single application library")
35-
FOREACH(TOP_INCLUDE_PATH in ${Qt5Widgets_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR})
35+
FOREACH(TOP_INCLUDE_PATH in ${Qt5Core_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR})
3636
FIND_PATH(QTSINGLEAPPLICATION_INCLUDE_DIR QtSingleApplication ${TOP_INCLUDE_PATH}/QtSolutions)
3737

3838
IF(QTSINGLEAPPLICATION_INCLUDE_DIR)
@@ -43,12 +43,12 @@ ELSEIF(Qt5Widgets_FOUND)
4343
SET(QTSINGLEAPPLICATION_NAMES ${QTSINGLEAPPLICATION_NAMES}
4444
Qt5Solutions_SingleApplication-2.6 libQt5Solutions_SingleApplication-2.6
4545
QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6)
46-
GET_TARGET_PROPERTY(QT5_WIDGETSLIBRARY Qt5::Widgets LOCATION)
47-
GET_FILENAME_COMPONENT(QT5_WIDGETSLIBRARYPATH ${QT5_WIDGETSLIBRARY} PATH)
46+
GET_TARGET_PROPERTY(_QT5_CORELIBRARY Qt5::Core LOCATION)
47+
GET_FILENAME_COMPONENT(_QT5_CORELIBRARYPATH ${_QT5_CORELIBRARY} PATH)
4848

4949
FIND_LIBRARY(QTSINGLEAPPLICATION_LIBRARY
5050
NAMES ${QTSINGLEAPPLICATION_NAMES}
51-
PATHS ${QT5_WIDGETSLIBRARYPATH}
51+
PATHS ${_QT5_CORELIBRARYPATH}
5252
)
5353
ENDIF()
5454

0 commit comments

Comments
 (0)