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
TcpClient.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
${OpenCV_LIBS}
@@ -37,9 +37,9 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found.
ADD_EXECUTABLE(tcpClient ${SRC_FILES})
TARGET_LINK_LIBRARIES(tcpClient ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
IF(Qt5_FOUND)
QT5_USE_MODULES(tcpClient Widgets Core Gui Network PrintSupport)
ENDIF()
ENDIF(Qt5_FOUND)
SET_TARGET_PROPERTIES( tcpClient
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpClient)
+5 -5
View File
@@ -3,7 +3,7 @@ SET(headers_ui
ImagesTcpServer.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
${OpenCV_LIBS}
@@ -37,9 +37,9 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found.
ADD_EXECUTABLE(tcpImagesServer ${SRC_FILES})
TARGET_LINK_LIBRARIES(tcpImagesServer find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
IF(Qt5_FOUND)
QT5_USE_MODULES(tcpImagesServer Widgets Core Gui Network PrintSupport)
ENDIF()
ENDIF(Qt5_FOUND)
SET_TARGET_PROPERTIES( tcpImagesServer
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpImagesServer)
+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)
+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)