[vlmc-devel] cmake: Fix fallback to qt4 if qt5 is not found

Hugo Beauzée-Luyssen git at videolan.org
Wed Feb 5 00:24:32 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Feb  5 01:20:51 2014 +0200| [698807ab95a2599e2de7647af8251244b8365386] | committer: Hugo Beauzée-Luyssen

cmake: Fix fallback to qt4 if qt5 is not found

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=698807ab95a2599e2de7647af8251244b8365386
---

 CMakeLists.txt |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f2c041..dee919a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,16 +115,15 @@ INCLUDE_DIRECTORIES(${FREI0R_INCLUDE_DIR})
 
 # search for Qt4
 if (NOT FORCE_QT4)
-    message(STATUS "using qt5")
-    find_package(Qt5Core )
-    if (Qt5Core_DIR)
+	find_package(Qt5Core QUIET)
+	if (Qt5Core_FOUND)
+		message(STATUS "Using qt5")
         # go on with other packages
         if(WITH_GUI)
             find_package(Qt5 COMPONENTS Widgets Gui Xml Network)
         else()
             find_packages(Qt5 COMPONENTS Xml Network)
         endif()
-        message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!")
 
 		macro(qt_use_modules)
 			qt5_use_modules(${ARGN})
@@ -143,7 +142,8 @@ if (NOT FORCE_QT4)
             qt5_add_translation(${ARGN})
         endmacro()
     endif()
-else()
+endif()
+if(NOT Qt5Core_FOUND)
     message(STATUS "Could not find Qt5, searching for Qt4 instead...")
 
 	set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork") 



More information about the Vlmc-devel mailing list