From 924286da8ff5b3d0a42b2e93beada80abb43b4cd Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 13 Jun 2021 23:38:48 +0300 Subject: [PATCH] Use manual checks instead of cmake_minimum_required to propagate policies. --- benchmark/CMakeLists.txt | 4 +++- sqlite/CMakeLists.txt | 4 +++- td/generate/CMakeLists.txt | 4 +++- tdactor/CMakeLists.txt | 4 +++- tddb/CMakeLists.txt | 4 +++- tdnet/CMakeLists.txt | 4 +++- tdtl/CMakeLists.txt | 4 +++- tdutils/CMakeLists.txt | 4 +++- tdutils/generate/CMakeLists.txt | 4 +++- test/CMakeLists.txt | 4 +++- 10 files changed, 30 insertions(+), 10 deletions(-) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 78bb649f5..c4f17cae9 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() if (NOT OPENSSL_FOUND) find_package(OpenSSL REQUIRED) diff --git a/sqlite/CMakeLists.txt b/sqlite/CMakeLists.txt index 30ab83e51..091b00cde 100644 --- a/sqlite/CMakeLists.txt +++ b/sqlite/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() if (NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR "lib") diff --git a/td/generate/CMakeLists.txt b/td/generate/CMakeLists.txt index 7e0e2c6b5..e7f6aea06 100644 --- a/td/generate/CMakeLists.txt +++ b/td/generate/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() if (NOT DEFINED CMAKE_INSTALL_BINDIR) set(CMAKE_INSTALL_BINDIR "bin") diff --git a/tdactor/CMakeLists.txt b/tdactor/CMakeLists.txt index 3cec195fa..c20af79cd 100644 --- a/tdactor/CMakeLists.txt +++ b/tdactor/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() if (NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR "lib") diff --git a/tddb/CMakeLists.txt b/tddb/CMakeLists.txt index 05a9dc00d..036f0ca61 100644 --- a/tddb/CMakeLists.txt +++ b/tddb/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() if (NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR "lib") diff --git a/tdnet/CMakeLists.txt b/tdnet/CMakeLists.txt index b385bc236..c81d031b4 100644 --- a/tdnet/CMakeLists.txt +++ b/tdnet/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() if (NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR "lib") diff --git a/tdtl/CMakeLists.txt b/tdtl/CMakeLists.txt index b0f83cd98..8b139ddc6 100644 --- a/tdtl/CMakeLists.txt +++ b/tdtl/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() #SOURCE SETS set(TDTL_SOURCE diff --git a/tdutils/CMakeLists.txt b/tdutils/CMakeLists.txt index 61fd1f1e2..d4ddc09e8 100644 --- a/tdutils/CMakeLists.txt +++ b/tdutils/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() option(TDUTILS_MIME_TYPE "Generate mime types conversion; requires gperf" ON) diff --git a/tdutils/generate/CMakeLists.txt b/tdutils/generate/CMakeLists.txt index c0254e925..82f544934 100644 --- a/tdutils/generate/CMakeLists.txt +++ b/tdutils/generate/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() # Generates files for MIME type <-> extension conversions # DEPENDS ON: gperf grep bash/powershell diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dfba657ef..0a4d9413c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) + message(FATAL_ERROR "CMake >= 3.0.2 is required") +endif() #SOURCE SETS set(TD_TEST_SOURCE