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
+5 -5
View File
@@ -3,7 +3,7 @@ SET(headers_ui
TcpResponse.h
)
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
IF(QT4_FOUND)
QT4_WRAP_CPP(moc_srcs ${headers_ui})
ELSE()
QT5_WRAP_CPP(moc_srcs ${headers_ui})
@@ -21,9 +21,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
@@ -38,9 +38,9 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found.
ADD_EXECUTABLE(tcpRequest ${SRC_FILES})
TARGET_LINK_LIBRARIES(tcpRequest find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
IF(Qt5_FOUND)
QT5_USE_MODULES(tcpRequest Widgets Core Gui Network PrintSupport)
ENDIF()
ENDIF(Qt5_FOUND)
SET_TARGET_PROPERTIES( tcpRequest
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpRequest)