Commit 698807ab authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

cmake: Fix fallback to qt4 if qt5 is not found

parent 5e4f4461
...@@ -115,16 +115,15 @@ INCLUDE_DIRECTORIES(${FREI0R_INCLUDE_DIR}) ...@@ -115,16 +115,15 @@ INCLUDE_DIRECTORIES(${FREI0R_INCLUDE_DIR})
# search for Qt4 # search for Qt4
if (NOT FORCE_QT4) if (NOT FORCE_QT4)
message(STATUS "using qt5") find_package(Qt5Core QUIET)
find_package(Qt5Core ) if (Qt5Core_FOUND)
if (Qt5Core_DIR) message(STATUS "Using qt5")
# go on with other packages # go on with other packages
if(WITH_GUI) if(WITH_GUI)
find_package(Qt5 COMPONENTS Widgets Gui Xml Network) find_package(Qt5 COMPONENTS Widgets Gui Xml Network)
else() else()
find_packages(Qt5 COMPONENTS Xml Network) find_packages(Qt5 COMPONENTS Xml Network)
endif() endif()
message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!")
macro(qt_use_modules) macro(qt_use_modules)
qt5_use_modules(${ARGN}) qt5_use_modules(${ARGN})
...@@ -143,7 +142,8 @@ if (NOT FORCE_QT4) ...@@ -143,7 +142,8 @@ if (NOT FORCE_QT4)
qt5_add_translation(${ARGN}) qt5_add_translation(${ARGN})
endmacro() endmacro()
endif() endif()
else() endif()
if(NOT Qt5Core_FOUND)
message(STATUS "Could not find Qt5, searching for Qt4 instead...") message(STATUS "Could not find Qt5, searching for Qt4 instead...")
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork") set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment