summaryrefslogtreecommitdiff
blob: e9e68af826fb54148e0367603146abaa5f98b691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
From 8480a1c62aa99b6a73a76c9af80392568e0dae5e Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Fri, 13 Apr 2018 21:09:17 +0200
Subject: [PATCH 1/2] Fix cmake with Qt 5.11_beta3

---
 cmake/MacBuildTarget.cmake  | 4 ++--
 cmake/UnixBuildTarget.cmake | 4 ++--
 cmake/WinBuildTarget.cmake  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cmake/MacBuildTarget.cmake b/cmake/MacBuildTarget.cmake
index eae9a76b..54633ca1 100644
--- a/cmake/MacBuildTarget.cmake
+++ b/cmake/MacBuildTarget.cmake
@@ -66,8 +66,8 @@ add_dependencies(
 	${QUAZIP_DEPENDENCY} 
 	${LIBQPSD_LIBRARY}) 
 
-qt5_use_modules(${BINARY_NAME} 		Widgets Gui Network LinguistTools PrintSupport Concurrent Svg)
-qt5_use_modules(${DLL_CORE_NAME} 	Widgets Gui Network LinguistTools PrintSupport Concurrent Svg)
+qt5_use_modules(${BINARY_NAME} Qt5::Widgets Qt5::Gui Qt5::Network Qt5::PrintSupport Qt5::Concurrent Qt5::Svg)
+qt5_use_modules(${DLL_CORE_NAME} Qt5::Widgets Qt5::Gui Qt5::Network Qt5::PrintSupport Qt5::Concurrent Qt5::Svg)
 
 # core flags
 set_target_properties(${DLL_CORE_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/libs)
diff --git a/cmake/UnixBuildTarget.cmake b/cmake/UnixBuildTarget.cmake
index 4eb3108e..3f592764 100644
--- a/cmake/UnixBuildTarget.cmake
+++ b/cmake/UnixBuildTarget.cmake
@@ -58,8 +58,8 @@ add_dependencies(
 	${QUAZIP_DEPENDENCY}
 	${LIBQPSD_LIBRARY})
 
-qt5_use_modules(${BINARY_NAME} 		Widgets Gui Network LinguistTools PrintSupport Concurrent Svg)
-qt5_use_modules(${DLL_CORE_NAME} 	Widgets Gui Network LinguistTools PrintSupport Concurrent Svg)
+target_link_libraries(${BINARY_NAME} Qt5::Widgets Qt5::Gui Qt5::Network Qt5::PrintSupport Qt5::Concurrent Qt5::Svg)
+target_link_libraries(${DLL_CORE_NAME} Qt5::Widgets Qt5::Gui Qt5::Network Qt5::PrintSupport Qt5::Concurrent Qt5::Svg)
 
 # core flags
 set_target_properties(${DLL_CORE_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/libs)
diff --git a/cmake/WinBuildTarget.cmake b/cmake/WinBuildTarget.cmake
index 9a71d508..63a4b27d 100644
--- a/cmake/WinBuildTarget.cmake
+++ b/cmake/WinBuildTarget.cmake
@@ -62,8 +62,8 @@ add_dependencies(
 target_include_directories(${BINARY_NAME} 		PRIVATE ${OpenCV_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
 target_include_directories(${DLL_CORE_NAME} 	PRIVATE ${OpenCV_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
 
-qt5_use_modules(${BINARY_NAME} 		Widgets Gui Network LinguistTools PrintSupport Concurrent Svg WinExtras)
-qt5_use_modules(${DLL_CORE_NAME} 	Widgets Gui Network LinguistTools PrintSupport Concurrent Svg WinExtras)
+target_link_libraries(${BINARY_NAME} Qt5::Widgets Qt5::Gui Qt5::Network Qt5::PrintSupport Qt5::Concurrent Qt5::Svg Qt5::WinExtras)
+target_link_libraries(${DLL_CORE_NAME} Qt5::Widgets Qt5::Gui Qt5::Network Qt5::PrintSupport Qt5::Concurrent Qt5::Svg Qt5::WinExtras)
 
 # set(_moc ${CMAKE_CURRENT_BINARY_DIR}/GeneratedFiles)
 file(GLOB NOMACS_AUTOMOC "${CMAKE_BINARY_DIR}/*_automoc.cpp ${CMAKE_BINARY_DIR}/moc_.cpp")
-- 
2.17.0


From 6c400cb6341e4c15413b0406d575779a6f3ce6c5 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Fri, 13 Apr 2018 21:36:15 +0200
Subject: [PATCH 2/2] Require minimum Qt5 version as documented in README.md

---
 CMakeLists.txt    | 2 ++
 cmake/Utils.cmake | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5869c2c6..5b9abe67 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,8 @@ set(NOMACS_BUILD_DIRECTORY ${CMAKE_BINARY_DIR})
 # include macros needed
 include("cmake/Utils.cmake")
 
+set(QT5_MIN_VERSION 5.2.1)
+
 # different compile options
 option(ENABLE_OPENCV "Compile with Opencv (needed for RAW and TIFF)" ON)
 option(ENABLE_RAW "Compile with raw images support (libraw)" ON)
diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake
index 5ea88a69..bdd547cb 100644
--- a/cmake/Utils.cmake
+++ b/cmake/Utils.cmake
@@ -17,10 +17,10 @@ macro(NMC_FINDQT)
 	 set(QT_ROOT ${QT_QMAKE_PATH}/)
 	 set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT_QMAKE_PATH}\\..\\lib\\cmake\\Qt5)
 	 	 
-	 find_package(Qt5 REQUIRED  Core Widgets Network LinguistTools PrintSupport Concurrent Gui Svg)
+	 find_package(Qt5 ${QT5_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network LinguistTools PrintSupport Concurrent Gui Svg)
 	 
 	if (MSVC)
-		find_package(Qt5 REQUIRED WinExtras)
+		find_package(Qt5 ${QT5_MIN_VERSION} REQUIRED WinExtras)
 	endif()
 	 
 	 if (NOT Qt5_FOUND)
-- 
2.17.0