# Main use cases for COMPAT\_VERSION of project() (in new CMake 4.1)

**URL:** https://discourse.cmake.org/t/main-use-cases-for-compat-version-of-project-in-new-cmake-4-1/14289
**Category:** Usage
**Created:** [June 27, 2025, 10:47am UTC](https://discourse.cmake.org/t/main-use-cases-for-compat-version-of-project-in-new-cmake-4-1/14289 "2025-06-27T10:47:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![leha-bot](https://discourse.cmake.org/user_avatar/discourse.cmake.org/leha-bot/32/921_2.png) [@leha-bot](https://discourse.cmake.org/u/leha-bot)
#### Post date: [June 27, 2025, 10:47am UTC](https://discourse.cmake.org/t/main-use-cases-for-compat-version-of-project-in-new-cmake-4-1/14289/1 "2025-06-27T10:47:07Z")

</div>

It’s unclear the main usage of this feature and potential use-cases. The most similar things I thought, was [write\_basic\_package\_version\_file](https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#command:write_basic_package_version_file) and their COMPATIBILITY ( `AnyNewerVersion`, `SameMinor`, `SameMajor`, `ExactVersion`)

---

<div class="post-metadata">

### Author: ![vito.gamberini](https://discourse.cmake.org/user_avatar/discourse.cmake.org/vito.gamberini/32/4376_2.png) [@vito.gamberini](https://discourse.cmake.org/u/vito.gamberini)
#### Post date: [June 28, 2025, 3:46pm UTC](https://discourse.cmake.org/t/main-use-cases-for-compat-version-of-project-in-new-cmake-4-1/14289/2 "2025-06-28T15:46:19Z")

</div>

CPS has a more comprehensive concept of compatibility than the enumerated set of options provided by `write_basic_package_version_file()`, namely here a minimum version back to which the artifact is fully backwards compatible. This might span multiple major versions, but not all.

`COMPAT_VERSION` is explicitly for CPS, it has no bearing on the CMakeConfig system or the mechanisms provided by `<package>-config-version` files that system uses.

---

<div class="post-metadata">

### Author: ![leha-bot](https://discourse.cmake.org/user_avatar/discourse.cmake.org/leha-bot/32/921_2.png) [@leha-bot](https://discourse.cmake.org/u/leha-bot)
#### Post date: [June 28, 2025, 4:03pm UTC](https://discourse.cmake.org/t/main-use-cases-for-compat-version-of-project-in-new-cmake-4-1/14289/3 "2025-06-28T16:03:48Z")

</div>

oh, thanks, actually forgot about this CPS aspect, time to recheck the spec 🙂
