From 69638a5ddb725c4f8000f86546d5d41f2917fe40 Mon Sep 17 00:00:00 2001 From: Johannes Huber Date: Thu, 30 May 2013 00:03:45 +0200 Subject: [PATCH] Add Qt5 build option. * removes automagic build when Qt4 + Qt5 is installed on system --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aba9032..f601a11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,16 @@ set(QTKEYCHAIN_SOVERSION 0) set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Modules") include(GNUInstallDirs) +option(QT5_BUILD "Build qtkeychain using the Qt5 framework" TRUE) + +if(QT5_BUILD) + find_package(Qt5Core QUIET) +else() + find_package(Qt4 REQUIRED) + include(${QT_USE_FILE}) +endif() + # try Qt5 first, and prefer that if found -find_package(Qt5Core QUIET) if (Qt5Core_FOUND) if(UNIX AND NOT APPLE) find_package(Qt5DBus REQUIRED) -- 1.8.2.1