Browse Source

Merge pull request #9199 from zeule/cmake

Use proper include files in the QtSingleApplication find module.
adaptive-webui-19844
sledgehammer999 6 years ago committed by GitHub
parent
commit
a87d1d43fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      cmake/Modules/FindQtSingleApplication.cmake

41
cmake/Modules/FindQtSingleApplication.cmake

@ -12,45 +12,30 @@
SET(QtSingleApplication_FOUND FALSE) SET(QtSingleApplication_FOUND FALSE)
IF(QT4_FOUND) if (Qt5Widgets_FOUND)
message(STATUS "Looking for Qt4 single application library") set(_includeFileName qtsingleapplication.h)
FIND_PATH(QtSingleApplication_INCLUDE_DIR QtSingleApplication else()
# standard locations set(_includeFileName qtsinglecoreapplication.h)
/usr/include endif()
/usr/include/QtSolutions
# qt4 location except mac's frameworks
"${QT_INCLUDE_DIR}/QtSolutions"
# mac's frameworks
${FRAMEWORK_INCLUDE_DIR}/QtSolutions
)
SET(QtSingleApplication_NAMES ${QtSingleApplication_NAMES} FOREACH(TOP_INCLUDE_PATH in ${Qt5Core_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR})
QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6) FIND_PATH(QtSingleApplication_INCLUDE_DIR ${_includeFileName} ${TOP_INCLUDE_PATH}/QtSolutions)
FIND_LIBRARY(QtSingleApplication_LIBRARY
NAMES ${QtSingleApplication_NAMES}
PATHS ${QT_LIBRARY_DIR}
)
ELSEIF(Qt5Core_FOUND)
message(STATUS "Looking for Qt5 single application library")
FOREACH(TOP_INCLUDE_PATH in ${Qt5Core_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR})
FIND_PATH(QtSingleApplication_INCLUDE_DIR QtSingleApplication ${TOP_INCLUDE_PATH}/QtSolutions)
IF(QtSingleApplication_INCLUDE_DIR) IF(QtSingleApplication_INCLUDE_DIR)
BREAK() BREAK()
ENDIF() ENDIF()
ENDFOREACH() ENDFOREACH()
SET(QtSingleApplication_NAMES ${QtSingleApplication_NAMES} SET(QtSingleApplication_NAMES ${QtSingleApplication_NAMES}
Qt5Solutions_SingleApplication-2.6 libQt5Solutions_SingleApplication-2.6 Qt5Solutions_SingleApplication-2.6 libQt5Solutions_SingleApplication-2.6
QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6) QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6)
GET_TARGET_PROPERTY(_QT5_CORELIBRARY Qt5::Core LOCATION) GET_TARGET_PROPERTY(_QT5_CORELIBRARY Qt5::Core LOCATION)
GET_FILENAME_COMPONENT(_QT5_CORELIBRARYPATH ${_QT5_CORELIBRARY} PATH) GET_FILENAME_COMPONENT(_QT5_CORELIBRARYPATH ${_QT5_CORELIBRARY} PATH)
FIND_LIBRARY(QtSingleApplication_LIBRARY FIND_LIBRARY(QtSingleApplication_LIBRARY
NAMES ${QtSingleApplication_NAMES} NAMES ${QtSingleApplication_NAMES}
PATHS ${_QT5_CORELIBRARYPATH} PATHS ${_QT5_CORELIBRARYPATH}
) )
ENDIF()
IF (QtSingleApplication_LIBRARY AND QtSingleApplication_INCLUDE_DIR) IF (QtSingleApplication_LIBRARY AND QtSingleApplication_INCLUDE_DIR)

Loading…
Cancel
Save