# Silencing \`Compatibility with CMake \< 3.10 will be removed\` message

**URL:** https://discourse.cmake.org/t/silencing-compatibility-with-cmake-3-10-will-be-removed-message/15197
**Category:** Usage
**Created:** [September 25, 2025, 5:05pm UTC](https://discourse.cmake.org/t/silencing-compatibility-with-cmake-3-10-will-be-removed-message/15197 "2025-09-25T17:05:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![alcroito](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alcroito/32/186_2.png) [@alcroito](https://discourse.cmake.org/u/alcroito)
#### Post date: [September 25, 2025, 5:05pm UTC](https://discourse.cmake.org/t/silencing-compatibility-with-cmake-3-10-will-be-removed-message/15197/1 "2025-09-25T17:05:23Z")

</div>

Hi,

When configuring a project with cmake 3.31+ and a cmake toolchain file provided by an Android NDK \< r28, one will see the following deprecation warning:

```auto
$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(app LANGUAGES CXX)

$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/Users/alex/Dev/android/sdk/ndk/27.2.12479018/build/cmake/android.toolchain.cmake

CMake Deprecation Warning at /Users/alex/Dev/android/sdk/ndk/27.2.12479018/build/cmake/android.toolchain.cmake:35 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

```

This can be silenced if one configures the project with `cmake . -Wno-deprecated` or with `cmake . -DCMAKE_WARN_DEPRECATED=OFF`

Unfortunately that will silence all deprecation warnings.

Is there a way to silence just this specific deprecation warning, without any others, thus accidentally silencing other deprecation warnings a project might care about?

I considered wrapping a `project` call with `set(`DCMAKE_WARN_DEPRECATED ON) set(DCMAKE_WARN_DEPRECATED OFF)`` but that will still silence any other deprecation warnings within the toolchain file, and it also requires editing the project.

As an aside, the warning doesn’t appear with ndk r28+, because they bumped the minimum to 3.10 see [https://github.com/android/ndk/issues/2100](https://github.com/android/ndk/issues/2100) and [799e5a2d44cc2cc6c7d67f52f2d67957944b7680 - platform/ndk - Git at Google](https://android.googlesource.com/platform/ndk/+/799e5a2d44cc2cc6c7d67f52f2d67957944b7680)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [September 25, 2025, 5:33pm UTC](https://discourse.cmake.org/t/silencing-compatibility-with-cmake-3-10-will-be-removed-message/15197/2 "2025-09-25T17:33:54Z")

</div>

See the [`CMAKE_POLICY_VERSION_MINIMUM`](https://cmake.org/cmake/help/latest/envvar/CMAKE_POLICY_VERSION_MINIMUM.html) environment variable.

You can also set it with `-D` on the command line (I don’t believe project code will be able to reliably set something earlier than the toolchain though).

---

<div class="post-metadata">

### Author: ![alcroito](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alcroito/32/186_2.png) [@alcroito](https://discourse.cmake.org/u/alcroito)
#### Post date: [September 25, 2025, 6:21pm UTC](https://discourse.cmake.org/t/silencing-compatibility-with-cmake-3-10-will-be-removed-message/15197/3 "2025-09-25T18:21:02Z")

</div>

While an option, that is a behavior change, causing the android toolchain file code to run with NEWer policies.

There aren’t that many policies between 3.6 and 3.10, so I suppose i could check if that won’t have any negative consequences on user projects.
