Commit | Line | Data |
---|---|---|
01c48690 PL |
1 | From 0d76d960727018bddf04c6cc89552af69aaa7e55 Mon Sep 17 00:00:00 2001 |
2 | From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com> | |
3 | Date: Sun, 15 Apr 2018 22:20:34 +0200 | |
4 | Subject: [PATCH] Add missing Qt5Network, Qt5Test, make BUILD_WITH_QT4 more | |
5 | strict | |
6 | ||
7 | --- | |
8 | CMakeLists.txt | 22 +++++++++++----------- | |
9 | 1 file changed, 11 insertions(+), 11 deletions(-) | |
10 | ||
11 | diff --git a/CMakeLists.txt b/CMakeLists.txt | |
12 | index 2a1f652..eb006d9 100644 | |
13 | --- a/CMakeLists.txt | |
14 | +++ b/CMakeLists.txt | |
15 | @@ -5,25 +5,25 @@ project( libmygpo-qt ) | |
16 | set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) | |
17 | set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII" ) | |
18 | ||
19 | -option(BUILD_WITH_QT4 "Build libmygpo-qt with Qt4 no matter if Qt5 was found" OFF) | |
20 | +option(BUILD_WITH_QT4 "Build libmygpo-qt with Qt4" OFF) | |
21 | ||
22 | if( NOT BUILD_WITH_QT4 ) | |
23 | - find_package(Qt5Core QUIET) | |
24 | - if( Qt5Core_DIR ) | |
25 | - set(MYGPO_QT_VERSION_SUFFIX 5) | |
26 | - | |
27 | - macro(qt_wrap_cpp) | |
28 | - qt5_wrap_cpp(${ARGN}) | |
29 | - endmacro() | |
30 | + if( MYGPO_BUILD_TESTS ) | |
31 | + find_package(Qt5 REQUIRED COMPONENTS Core Network Test CONFIG) | |
32 | + else() | |
33 | + find_package(Qt5 REQUIRED COMPONENTS Core Network CONFIG) | |
34 | endif() | |
35 | + set(MYGPO_QT_VERSION_SUFFIX 5) | |
36 | + | |
37 | + macro(qt_wrap_cpp) | |
38 | + qt5_wrap_cpp(${ARGN}) | |
39 | + endmacro() | |
40 | ||
41 | # pkg-config names of QtCore and QtNetwork are Qt5Core and Qt5Network for | |
42 | # Qt5 | |
43 | set(MYGPO_QT_MAJOR_VERSION "5") | |
44 | set(MYGPO_QT4_QJSON_DEP "") | |
45 | -endif() | |
46 | - | |
47 | -if( NOT Qt5Core_DIR ) | |
48 | +else() | |
49 | message(STATUS "Could not find Qt5, searching for Qt4 instead...") | |
50 | message(STATUS "Qt4 Support is deprecated, building with Qt4 is no longer officially supported") | |
51 | if( MYGPO_BUILD_TESTS ) |