From abc47b334efe4f950fa73bec8fa80d5982e337b4 Mon Sep 17 00:00:00 2001
From: Kitsune Ral <Kitsune-Ral@users.sf.net>
Date: Thu, 27 Oct 2016 12:13:55 +0900
Subject: Use more compact syntax for find_package; display prefix path to Qt

Qt5Core_DIR shows a path to the .cmake file's directory, which is a little too much information. The same change will be made in Quaternion, with the Qt prefix having additional usage in installation.
---
 CMakeLists.txt | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5449446b..eea2f5dd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,18 +19,19 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
     "MinSizeRel" "RelWithDebInfo")
 endif()
 
-find_package(Qt5Core 5.2.0 REQUIRED) # For JSON (de)serialization
-find_package(Qt5Network 5.2.0 REQUIRED) # For networking
-find_package(Qt5Gui 5.2.0 REQUIRED) # For userpics
+find_package(Qt5 5.2.1 REQUIRED Network Gui)
+get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE)
 
 message( STATUS )
-message( STATUS "================================================================================" )
-message( STATUS "                          libqmatrixclient Build Information                          " )
-message( STATUS "================================================================================" )
+message( STATUS "=============================================================================" )
+message( STATUS "                       libqmatrixclient Build Information" )
+message( STATUS "=============================================================================" )
 message( STATUS "Building with: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" )
-message( STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}" )
-message( STATUS "Path to Qt Core: ${Qt5Core_DIR}" )
-message( STATUS "================================================================================" )
+if (CMAKE_BUILD_TYPE)
+    message( STATUS "Build type: ${CMAKE_BUILD_TYPE}")
+endif(CMAKE_BUILD_TYPE)
+message( STATUS "Building with Qt ${Qt5_VERSION} at: ${Qt5_Prefix}" )
+message( STATUS "=============================================================================" )
 message( STATUS )
 
 # Set up source files
-- 
cgit v1.2.3