fix: support CMake 3.27, drop 3.4 (#4719)

* fix: support CMake 3.27, drop 3.4

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update upgrade.rst

* Update upgrade.rst

* Update upgrade.rst

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner
2023-07-12 13:10:24 -05:00
committed by GitHub
parent 6d22dba82f
commit 2e5f5c4cf8
16 changed files with 75 additions and 49 deletions

View File

@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 3.4)
cmake_minimum_required(VERSION 3.5)
project(test_installed_module CXX)
# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with
# The `cmake_minimum_required(VERSION 3.5...3.26)` syntax does not work with
# some versions of VS that have a patched CMake 3.11. This forces us to emulate
# the behavior using the following workaround:
if(${CMAKE_VERSION} VERSION_LESS 3.18)
if(${CMAKE_VERSION} VERSION_LESS 3.26)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.18)
cmake_policy(VERSION 3.26)
endif()
project(test_installed_function CXX)