# CMP0143 seemingly not working, how to debug?

**URL:** https://discourse.cmake.org/t/cmp0143-seemingly-not-working-how-to-debug/13828
**Category:** Code
**Tags:** os:windows, gen:vs
**Created:** [March 26, 2025, 3:18pm UTC](https://discourse.cmake.org/t/cmp0143-seemingly-not-working-how-to-debug/13828 "2025-03-26T15:18:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aursulis](https://discourse.cmake.org/user_avatar/discourse.cmake.org/aursulis/32/5450_2.png) [@aursulis](https://discourse.cmake.org/u/aursulis)
#### Post date: [March 26, 2025, 3:18pm UTC](https://discourse.cmake.org/t/cmp0143-seemingly-not-working-how-to-debug/13828/1 "2025-03-26T15:18:08Z")

</div>

Hi there, a colleague of mine was upgrading our CMake version from 3.24.2 to 3.31.6 (along with all the policy changes) and we stumbled upon some strange behaviour with the USE\_FOLDERS property which should now default to ON.

We have been explicitly setting: set\_property(GLOBAL PROPERTY USE\_FOLDERS ON) before and thought we could remove those calls now with the new policies, but the generated VS solutions didn’t have any folders in them.

I believe we checked that: USE\_FOLDERS is not set at the end of the top-level CMakeLists.txt, and that the CMP0143 policy value is NEW.

Putting an explicit call to set\_property at the end fixes this so we’re probably not going to spend much more time debugging it, but wanted to ask around what that would entail.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [March 26, 2025, 8:50pm UTC](https://discourse.cmake.org/t/cmp0143-seemingly-not-working-how-to-debug/13828/2 "2025-03-26T20:50:35Z")

</div>

It will only default to ON if you’ve updated your `cmake_minimum_required()` at the top of your project to include CMake 3.26 or later. Without that, you’re still getting OLD policy settings for all policies in CMake versions later than whatever your `cmake_minimum_required()` is set to.

---

<div class="post-metadata">

### Author: ![aursulis](https://discourse.cmake.org/user_avatar/discourse.cmake.org/aursulis/32/5450_2.png) [@aursulis](https://discourse.cmake.org/u/aursulis)
#### Post date: [March 26, 2025, 9:15pm UTC](https://discourse.cmake.org/t/cmp0143-seemingly-not-working-how-to-debug/13828/3 "2025-03-26T21:15:39Z")

</div>

Yes actually we have that, i.e. `cmake_minimum_required(VERSION 3.31.6)` as the very first statement in the top level CMakeLists.txt. It is not being called in a function either.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [March 27, 2025, 10:37pm UTC](https://discourse.cmake.org/t/cmp0143-seemingly-not-working-how-to-debug/13828/4 "2025-03-27T22:37:42Z")

</div>

Sounds like a bug then. If you’ve got a small, complete project that demonstrates the behavior, please open a new issue for it: [https://gitlab.kitware.com/cmake/cmake/-/issues/new](https://gitlab.kitware.com/cmake/cmake/-/issues/new)
