Skip to content

Commit e8ea701

Browse files
authored
CDRIVER-6059 Set CMake max policy version to 4.0 (#2066)
1 parent d2443f4 commit e8ea701

File tree

14 files changed

+18
-19
lines changed

14 files changed

+18
-19
lines changed

.evergreen/scripts/compile-std.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fi
119119
echo "Checking requested C standard is supported..."
120120
pushd "$(mktemp -d)"
121121
cat >CMakeLists.txt <<DOC
122-
cmake_minimum_required(VERSION 3.30)
122+
cmake_minimum_required(VERSION 3.30...4.0)
123123
project(c_standard_latest LANGUAGES C)
124124
set(c_std_version "${C_STD_VERSION:?}")
125125
if(c_std_version STREQUAL "latest") # Special-case MSVC's /std:clatest flag.

CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required (VERSION 3.15)
1+
cmake_minimum_required (VERSION 3.15...4.0)
22

33
list (INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/build/cmake")
44
# Defines BUILD_VERSION, which we use throughout:
@@ -348,11 +348,6 @@ if(WIN32)
348348
set (CMAKE_IMPORT_LIBRARY_SUFFIX .dll.lib)
349349
endif()
350350

351-
# https://cmake.org/cmake/help/v3.11/policy/CMP0042.html
352-
# Enable a CMake 3.0+ policy that sets CMAKE_MACOSX_RPATH by default, and
353-
# silence a CMake 3.11 warning that the old behavior is deprecated.
354-
cmake_policy (SET CMP0042 NEW)
355-
356351
# By default, ensure conformance with a minimum C standard.
357352
# Required extensions to the language (i.e. POSIX) are (re)enabled further below.
358353
if (NOT DEFINED CMAKE_C_STANDARD)

NEWS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ libmongoc 2.1.0 (Unreleased)
77

88
## Changes
99

10-
Removed:
10+
* The CMake project now sets a CMake policy max version of `4.0` (previously unset).
11+
12+
## Removed
1113

1214
* Support for Debian 9 and Debian 10.
1315

build/cmake/GenerateUninstaller.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cmake_policy(VERSION 3.15)
2-
31
if(NOT CMAKE_SCRIPT_MODE_FILE)
42
# We are being included from within a project, so we should generate the install rules
53
# The script name is "uninstall" by default:

src/libbson/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# 888
1212
# 888
1313

14-
cmake_minimum_required (VERSION 3.15)
14+
cmake_minimum_required (VERSION 3.15...4.0)
1515

1616
project (libbson
1717
LANGUAGES C

src/libbson/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
libbson 2.1.0 (Unreleased)
22
==========================
33

4+
Changed:
5+
6+
* The CMake project now sets a CMake policy max version of `4.0` (previously unset).
7+
48
Removed:
59

610
* Support for Debian 9 and Debian 10.

src/libbson/examples/cmake/find_package/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Demonstrates how to use the CMake 'find_package' mechanism to locate
1616
# and build against libbson.
1717

18-
cmake_minimum_required (VERSION 3.0)
18+
cmake_minimum_required (VERSION 3.15...4.0)
1919

2020
project (hello_bson LANGUAGES C)
2121

src/libbson/examples/cmake/find_package_static/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Demonstrates how to use the CMake 'find_package' mechanism to locate
1616
# and build against libbson.
1717

18-
cmake_minimum_required (VERSION 2.8)
18+
cmake_minimum_required (VERSION 3.15...4.0)
1919

2020
project (hello_bson LANGUAGES C)
2121

src/libmongoc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required (VERSION 3.15)
1+
cmake_minimum_required (VERSION 3.15...4.0)
22

33
project (libmongoc
44
LANGUAGES C

src/libmongoc/examples/cmake/find_package/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Demonstrates how to use the CMake 'find_package' mechanism to locate
1616
# and build against libmongoc.
1717

18-
cmake_minimum_required (VERSION 3.0)
18+
cmake_minimum_required (VERSION 3.15...4.0)
1919

2020
project (hello_mongoc LANGUAGES C)
2121

0 commit comments

Comments
 (0)