Auto find qt version (qt5 has priority)

This commit is contained in:
matlabbe
2016-05-06 16:54:18 -04:00
parent 5c21a76653
commit 52ce5076db
10 changed files with 48 additions and 42 deletions
+4 -4
View File
@@ -9,9 +9,9 @@ SET(INCLUDE_DIRS
${OpenCV_INCLUDE_DIRS}
)
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
IF(QT4_FOUND)
INCLUDE(${QT_USE_FILE})
ENDIF()
ENDIF(QT4_FOUND)
SET(LIBRARIES
${OpenCV_LIBS}
@@ -25,9 +25,9 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found.
ADD_EXECUTABLE(tcpService ${SRC_FILES})
TARGET_LINK_LIBRARIES(tcpService find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
IF(Qt5_FOUND)
QT5_USE_MODULES(tcpService Widgets Core Gui Network PrintSupport)
ENDIF()
ENDIF(Qt5_FOUND)
SET_TARGET_PROPERTIES( tcpService
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpService)