Switch to more robust check for Qt5 for cafUserInterface. This should be applied to other projects

This commit is contained in:
Gaute Lindkvist 2018-12-07 12:55:46 +01:00
parent c0b7b5d87e
commit c51b938d03

View File

@ -5,17 +5,16 @@ if (MSVC)
add_definitions(-DNOMINMAX)
endif (MSVC)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
else()
find_package(Qt4 COMPONENTS QtCore QtGui QtMain REQUIRED)
include(${QT_USE_FILE})
endif(Qt5Core_FOUND)
project (cafUserInterface)
# Qt
find_package(Qt5 COMPONENTS Core QUIET)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
else()
find_package(Qt4 COMPONENTS QtCore QtGui QtMain REQUIRED)
include(${QT_USE_FILE})
endif(Qt5Core_FOUND)
# These headers need to go through Qt's MOC compiler
set (MOC_HEADER_FILES