Browse Source

Qt-find_package call moved to root CMakeLists.txt

The framework is a required dependency for the project
Viktor Kopp 6 years ago
parent
commit
77e77225b4
4 changed files with 7 additions and 12 deletions
  1. 7 0
      CMakeLists.txt
  2. 0 5
      src/grpc/CMakeLists.txt
  3. 0 5
      src/protobuf/CMakeLists.txt
  4. 0 2
      tests/CMakeLists.txt

+ 7 - 0
CMakeLists.txt

@@ -14,6 +14,13 @@ if (NOT Protobuf_FOUND OR Protobuf_VERSION VERSION_LESS "3.0.0")
     add_subdirectory("${Protobuf_SOURCE_DIR}/cmake" ${Protobuf_BINARY_DIR})
 endif()
 
+# grpc target requires QT version not less than 5.11
+# earlier versions do not provide required Http2DirectAttribute: https://doc.qt.io/qt-5/whatsnew511.html
+find_package(Qt5 COMPONENTS Core Network REQUIRED)
+if (Qt5Core_VERSION VERSION_LESS "5.11.0")
+    message(FATAL_ERROR "Required Qt version is 5.11+")
+endif()
+
 set(CMAKE_CXX_STANDARD 14)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 

+ 0 - 5
src/grpc/CMakeLists.txt

@@ -1,8 +1,3 @@
-find_package(Qt5 COMPONENTS Core Network REQUIRED)
-if (Qt5Core_VERSION VERSION_LESS "5.8.0")
-    message(FATAL_ERROR "Required Qt version is 5.8+")
-endif()
-
 set(GRPC_SUPPORT_LIBRARY_TARGET qtgrpc)
 
 include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/src/protobuf)

+ 0 - 5
src/protobuf/CMakeLists.txt

@@ -1,8 +1,3 @@
-find_package(Qt5 COMPONENTS Core REQUIRED)
-if (Qt5Core_VERSION VERSION_LESS "5.11.0")
-    message(FATAL_ERROR "Required Qt version is 5.11+")
-endif()
-
 set(SUPPORT_LIBRARY_TARGET qtprotobufsupport)
 
 include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})

+ 0 - 2
tests/CMakeLists.txt

@@ -11,8 +11,6 @@ if (UNIX AND NOT GTest_FOUND)
     add_subdirectory(${GTest_SOURCE_DIR} ${GTest_BINARY_DIR})
 endif()
 
-find_package(Qt5 COMPONENTS Core REQUIRED)
-
 include_directories(${Qt5Core_INCLUDE_DIRS})
 set(CMAKE_INCLUDE_CURRENT_DIR OFF)
 set(CMAKE_AUTOMOC OFF)