|
|
@ -1,20 +1,20 @@ |
|
|
|
# - Try to find the QtSingleApplication includes and library |
|
|
|
# - Try to find the QtSingleApplication includes and library |
|
|
|
# which defines |
|
|
|
# which defines |
|
|
|
# |
|
|
|
# |
|
|
|
# QTSINGLEAPPLICATION_FOUND - system has QtSingleApplication |
|
|
|
# QtSingleApplication_FOUND - system has QtSingleApplication |
|
|
|
# QTSINGLEAPPLICATION_INCLUDE_DIR - where to find header QtSingleApplication |
|
|
|
# QtSingleApplication_INCLUDE_DIR - where to find header QtSingleApplication |
|
|
|
# QTSINGLEAPPLICATION_LIBRARIES - the libraries to link against to use QtSingleApplication |
|
|
|
# QtSingleApplication_LIBRARIES - the libraries to link against to use QtSingleApplication |
|
|
|
# QTSINGLEAPPLICATION_LIBRARY - where to find the QtSingleApplication library (not for general use) |
|
|
|
# QtSingleApplication_LIBRARY - where to find the QtSingleApplication library (not for general use) |
|
|
|
|
|
|
|
|
|
|
|
# copyright (c) 2013 TI_Eugene ti.eugene@gmail.com |
|
|
|
# copyright (c) 2013 TI_Eugene ti.eugene@gmail.com |
|
|
|
# |
|
|
|
# |
|
|
|
# Redistribution and use is allowed according to the terms of the FreeBSD license. |
|
|
|
# Redistribution and use is allowed according to the terms of the FreeBSD license. |
|
|
|
|
|
|
|
|
|
|
|
SET(QTSINGLEAPPLICATION_FOUND FALSE) |
|
|
|
SET(QtSingleApplication_FOUND FALSE) |
|
|
|
|
|
|
|
|
|
|
|
IF(QT4_FOUND) |
|
|
|
IF(QT4_FOUND) |
|
|
|
message(STATUS "Looking for Qt4 single application library") |
|
|
|
message(STATUS "Looking for Qt4 single application library") |
|
|
|
FIND_PATH(QTSINGLEAPPLICATION_INCLUDE_DIR QtSingleApplication |
|
|
|
FIND_PATH(QtSingleApplication_INCLUDE_DIR QtSingleApplication |
|
|
|
# standard locations |
|
|
|
# standard locations |
|
|
|
/usr/include |
|
|
|
/usr/include |
|
|
|
/usr/include/QtSolutions |
|
|
|
/usr/include/QtSolutions |
|
|
@ -24,71 +24,71 @@ IF(QT4_FOUND) |
|
|
|
${FRAMEWORK_INCLUDE_DIR}/QtSolutions |
|
|
|
${FRAMEWORK_INCLUDE_DIR}/QtSolutions |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
SET(QTSINGLEAPPLICATION_NAMES ${QTSINGLEAPPLICATION_NAMES} |
|
|
|
SET(QtSingleApplication_NAMES ${QtSingleApplication_NAMES} |
|
|
|
QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6) |
|
|
|
QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6) |
|
|
|
FIND_LIBRARY(QTSINGLEAPPLICATION_LIBRARY |
|
|
|
FIND_LIBRARY(QtSingleApplication_LIBRARY |
|
|
|
NAMES ${QTSINGLEAPPLICATION_NAMES} |
|
|
|
NAMES ${QtSingleApplication_NAMES} |
|
|
|
PATHS ${QT_LIBRARY_DIR} |
|
|
|
PATHS ${QT_LIBRARY_DIR} |
|
|
|
) |
|
|
|
) |
|
|
|
ELSEIF(Qt5Core_FOUND) |
|
|
|
ELSEIF(Qt5Core_FOUND) |
|
|
|
message(STATUS "Looking for Qt5 single application library") |
|
|
|
message(STATUS "Looking for Qt5 single application library") |
|
|
|
FOREACH(TOP_INCLUDE_PATH in ${Qt5Core_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR}) |
|
|
|
FOREACH(TOP_INCLUDE_PATH in ${Qt5Core_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR}) |
|
|
|
FIND_PATH(QTSINGLEAPPLICATION_INCLUDE_DIR QtSingleApplication ${TOP_INCLUDE_PATH}/QtSolutions) |
|
|
|
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() |
|
|
|
ENDIF() |
|
|
|
|
|
|
|
|
|
|
|
IF (QTSINGLEAPPLICATION_LIBRARY AND QTSINGLEAPPLICATION_INCLUDE_DIR) |
|
|
|
IF (QtSingleApplication_LIBRARY AND QtSingleApplication_INCLUDE_DIR) |
|
|
|
|
|
|
|
|
|
|
|
SET(QTSINGLEAPPLICATION_LIBRARIES ${QTSINGLEAPPLICATION_LIBRARY}) |
|
|
|
SET(QtSingleApplication_LIBRARIES ${QtSingleApplication_LIBRARY}) |
|
|
|
SET(QTSINGLEAPPLICATION_FOUND TRUE) |
|
|
|
SET(QtSingleApplication_FOUND TRUE) |
|
|
|
|
|
|
|
|
|
|
|
IF (CYGWIN) |
|
|
|
IF (CYGWIN) |
|
|
|
IF(BUILD_SHARED_LIBS) |
|
|
|
IF(BUILD_SHARED_LIBS) |
|
|
|
# No need to define QTSINGLEAPPLICATION_USE_DLL here, because it's default for Cygwin. |
|
|
|
# No need to define QtSingleApplication_USE_DLL here, because it's default for Cygwin. |
|
|
|
ELSE(BUILD_SHARED_LIBS) |
|
|
|
ELSE(BUILD_SHARED_LIBS) |
|
|
|
SET (QTSINGLEAPPLICATION_DEFINITIONS -DQTSINGLEAPPLICATION_STATIC) |
|
|
|
SET (QtSingleApplication_DEFINITIONS -DQTSINGLEAPPLICATION_STATIC) |
|
|
|
ENDIF(BUILD_SHARED_LIBS) |
|
|
|
ENDIF(BUILD_SHARED_LIBS) |
|
|
|
ENDIF (CYGWIN) |
|
|
|
ENDIF (CYGWIN) |
|
|
|
|
|
|
|
|
|
|
|
ENDIF (QTSINGLEAPPLICATION_LIBRARY AND QTSINGLEAPPLICATION_INCLUDE_DIR) |
|
|
|
ENDIF (QtSingleApplication_LIBRARY AND QtSingleApplication_INCLUDE_DIR) |
|
|
|
|
|
|
|
|
|
|
|
IF (QTSINGLEAPPLICATION_FOUND) |
|
|
|
IF (QtSingleApplication_FOUND) |
|
|
|
IF (NOT QtSingleApplication_FIND_QUIETLY) |
|
|
|
IF (NOT QtSingleApplication_FIND_QUIETLY) |
|
|
|
MESSAGE(STATUS "Found QtSingleApplication: ${QTSINGLEAPPLICATION_LIBRARY}") |
|
|
|
MESSAGE(STATUS "Found QtSingleApplication: ${QtSingleApplication_LIBRARY}") |
|
|
|
MESSAGE(STATUS " includes: ${QTSINGLEAPPLICATION_INCLUDE_DIR}") |
|
|
|
MESSAGE(STATUS " includes: ${QtSingleApplication_INCLUDE_DIR}") |
|
|
|
ENDIF (NOT QtSingleApplication_FIND_QUIETLY) |
|
|
|
ENDIF (NOT QtSingleApplication_FIND_QUIETLY) |
|
|
|
ELSE (QTSINGLEAPPLICATION_FOUND) |
|
|
|
if(NOT TARGET QtSingleApplication::QtSingleApplication) |
|
|
|
IF (QtSingleApplication_FIND_REQUIRED) |
|
|
|
|
|
|
|
MESSAGE(FATAL_ERROR "Could not find QtSingleApplication library") |
|
|
|
|
|
|
|
ENDIF (QtSingleApplication_FIND_REQUIRED) |
|
|
|
|
|
|
|
ENDIF (QTSINGLEAPPLICATION_FOUND) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED(QTSINGLEAPPLICATION_INCLUDE_DIR QTSINGLEAPPLICATION_LIBRARY) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT TARGET QtSingleApplication::QtSingleApplication) |
|
|
|
|
|
|
|
add_library(QtSingleApplication::QtSingleApplication UNKNOWN IMPORTED) |
|
|
|
add_library(QtSingleApplication::QtSingleApplication UNKNOWN IMPORTED) |
|
|
|
set_target_properties(QtSingleApplication::QtSingleApplication PROPERTIES |
|
|
|
set_target_properties(QtSingleApplication::QtSingleApplication PROPERTIES |
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${QTSINGLEAPPLICATION_INCLUDE_DIR}" |
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${QtSingleApplication_INCLUDE_DIR}" |
|
|
|
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${QTSINGLEAPPLICATION_INCLUDE_DIR}" |
|
|
|
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${QtSingleApplication_INCLUDE_DIR}" |
|
|
|
) |
|
|
|
) |
|
|
|
if(EXISTS "${QTSINGLEAPPLICATION_LIBRARY}") |
|
|
|
if(EXISTS "${QtSingleApplication_LIBRARY}") |
|
|
|
set_target_properties(QtSingleApplication::QtSingleApplication PROPERTIES |
|
|
|
set_target_properties(QtSingleApplication::QtSingleApplication PROPERTIES |
|
|
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" |
|
|
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" |
|
|
|
IMPORTED_LOCATION "${QTSINGLEAPPLICATION_LIBRARY}") |
|
|
|
IMPORTED_LOCATION "${QtSingleApplication_LIBRARY}") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endif(NOT TARGET QtSingleApplication::QtSingleApplication) |
|
|
|
endif(NOT TARGET QtSingleApplication::QtSingleApplication) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ELSE (QtSingleApplication_FOUND) |
|
|
|
|
|
|
|
IF (QtSingleApplication_FIND_REQUIRED) |
|
|
|
|
|
|
|
MESSAGE(FATAL_ERROR "Could not find QtSingleApplication library") |
|
|
|
|
|
|
|
ENDIF (QtSingleApplication_FIND_REQUIRED) |
|
|
|
|
|
|
|
ENDIF (QtSingleApplication_FOUND) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED(QtSingleApplication_INCLUDE_DIR QtSingleApplication_LIBRARY) |
|
|
|