comparison Resources/CMake/QtConfiguration.cmake @ 320:10d188d6e5cc am-2

compatibility with Qt4
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 12 Oct 2018 14:38:48 +0200
parents df5011cf903c
children ef31240a73f6
comparison
equal deleted inserted replaced
319:daa04d15192c 320:10d188d6e5cc
21 set(CMAKE_AUTOMOC ON) 21 set(CMAKE_AUTOMOC ON)
22 SET(CMAKE_AUTOUIC ON) 22 SET(CMAKE_AUTOUIC ON)
23 set(CMAKE_INCLUDE_CURRENT_DIR ON) 23 set(CMAKE_INCLUDE_CURRENT_DIR ON)
24 24
25 # Find the QtWidgets library 25 # Find the QtWidgets library
26 find_package(Qt5Widgets) 26 find_package(Qt5Widgets QUIET)
27 find_package(Qt5Core) 27
28 if (Qt5Widgets_FOUND)
29 message("Qt5 has been detected")
30 find_package(Qt5Core REQUIRED)
31 link_libraries(
32 Qt5::Widgets
33 Qt5::Core
34 )
35 else()
36 message("Qt5 has not been found, trying with Qt4")
37 find_package(Qt4 REQUIRED QtGui)
38 link_libraries(
39 Qt4::QtGui
40 )
41 endif()
28 42
29 list(APPEND QT_SOURCES 43 list(APPEND QT_SOURCES
30 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.cpp 44 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.cpp
31 ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp 45 ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp
32 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp 46 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp
33 ) 47 )
34 48
35 include_directories(${ORTHANC_STONE_ROOT}/Applications/Qt/) 49 include_directories(${ORTHANC_STONE_ROOT}/Applications/Qt/)
36 50
37 link_libraries(
38 Qt5::Widgets
39 Qt5::Core
40 )