Skip to content
Snippets Groups Projects
Verified Commit 9b540ee2 authored by Tim Kaune's avatar Tim Kaune
Browse files

Automatically propagate minimum required CMake version

The package config takes the minimum required CMake version from the
main project.

Also introduce the maximum supported CMake version for policy management.
parent 127b17aa
No related branches found
No related tags found
No related merge requests found
......@@ -19,10 +19,17 @@ License along with this program. If not, see
cmake_minimum_required(VERSION 3.25)
# If CMake >=3.24 is used, set policies up to v3.24 to NEW
# if (NOT ${CMAKE_VERSION} VERSION_LESS 3.24)
# cmake_policy(VERSION 3.24)
# endif()
set(CMAKE_MAXIMUM_SUPPORTED_VERSION 3.28)
# If CMAKE_VERSION <= CMAKE_MAXIMUM_SUPPORTED_VERSION is used, set policies up
# to CMAKE_VERSION to NEW
if (${CMAKE_VERSION} VERSION_LESS_EQUAL ${CMAKE_MAXIMUM_SUPPORTED_VERSION})
cmake_policy(VERSION ${CMAKE_VERSION})
# If CMAKE_VERSION > CMAKE_MAXIMUM_SUPPORTED_VERSION is used, set policies up to
# CMAKE_MAXIMUM_SUPPORTED_VERSION to NEW
else ()
cmake_policy(VERSION ${CMAKE_MAXIMUM_SUPPORTED_VERSION})
endif()
project(NetlibF2C VERSION 1.4.2 LANGUAGES C)
......
......@@ -17,12 +17,19 @@ License along with this program. If not, see
<https://www.gnu.org/licenses/>.
]]
cmake_minimum_required(VERSION 3.25)
# If CMake >=3.24 is used, set policies up to v3.24 to NEW
# if (NOT ${CMAKE_VERSION} VERSION_LESS 3.24)
# cmake_policy(VERSION 3.24)
# endif()
cmake_minimum_required(VERSION @CMAKE_MINIMUM_REQUIRED_VERSION@)
set(CMAKE_MAXIMUM_SUPPORTED_VERSION @CMAKE_MAXIMUM_SUPPORTED_VERSION@)
# If CMAKE_VERSION <= CMAKE_MAXIMUM_SUPPORTED_VERSION is used, set policies up
# to CMAKE_VERSION to NEW
if (${CMAKE_VERSION} VERSION_LESS_EQUAL ${CMAKE_MAXIMUM_SUPPORTED_VERSION})
cmake_policy(VERSION ${CMAKE_VERSION})
# If CMAKE_VERSION > CMAKE_MAXIMUM_SUPPORTED_VERSION is used, set policies up to
# CMAKE_MAXIMUM_SUPPORTED_VERSION to NEW
else ()
cmake_policy(VERSION ${CMAKE_MAXIMUM_SUPPORTED_VERSION})
endif()
set(
LoadStaticSharedTargets_DIR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment