From 1cf7fc78c6d674a17a472da0160509afc6519d3e Mon Sep 17 00:00:00 2001
From: Linda Lapinlampi <linda@lindalap.fi>
Date: Tue, 10 Aug 2021 09:55:20 +0000
Subject: [PATCH 1/2] Reintroduce cmake_policy for CMake < 3.12

CMake warnings may be raised at least with CMake 3.10 and CMake 3.11.

Quoting Blzut3 from #3824:

> Yeah the point of using a range is so that you can keep the minimum
> low while having all the new policies set to NEW automatically. I
> suppose you're correct that 3.10 and 3.11 would raise a warning on
> that though.

Partially reverts commit d6ec9cc. I am aware this commit does not
address the cmake_minimum_required version in src/core, but neither did
the original commit this one is reverting.
---
 src/core/CMakeLists.txt      | 8 ++++++++
 src/wadseeker/CMakeLists.txt | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index e9518d0b..d882cdf0 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -37,6 +37,14 @@ cmake_minimum_required(VERSION 2.8.12)
 # Conclusion: If current MSVC subsystem setup is changed the code may not
 # compile, as the proper entry point will be missing.
 
+# Suppress warnings for CMake < 3.12
+if (POLICY CMP0046)
+	cmake_policy(SET CMP0046 NEW)
+endif()
+if (POLICY CMP0071)
+	cmake_policy(SET CMP0071 NEW)
+endif()
+
 if (WIN32 OR APPLE)
 	set(DEFAULT_NONFREE_INSTALL "yes")
 else()
diff --git a/src/wadseeker/CMakeLists.txt b/src/wadseeker/CMakeLists.txt
index 2ff8105f..5a09cf21 100644
--- a/src/wadseeker/CMakeLists.txt
+++ b/src/wadseeker/CMakeLists.txt
@@ -22,6 +22,11 @@
 cmake_minimum_required(VERSION 3.5...3.21)
 project(Wadseeker)
 
+# Suppress warnings for CMake < 3.12
+if(POLICY CMP0042)
+	cmake_policy(SET CMP0042 NEW)
+endif()
+
 if (MSVC)
 	set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
 endif ()
-- 
2.32.0.rc2

