# FOLDER target property not working in Visual Studio 2022

**URL:** https://discourse.cmake.org/t/folder-target-property-not-working-in-visual-studio-2022/12759
**Category:** Usage
**Tags:** gen:vs
**Created:** [October 11, 2024, 9:56am UTC](https://discourse.cmake.org/t/folder-target-property-not-working-in-visual-studio-2022/12759 "2024-10-11T09:56:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Wallby](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/4491bb/32.png) [@Wallby](https://discourse.cmake.org/u/Wallby)
#### Post date: [October 11, 2024, 9:56am UTC](https://discourse.cmake.org/t/folder-target-property-not-working-in-visual-studio-2022/12759/1 "2024-10-11T09:56:09Z")

</div>

I tried both the FOLDER property as well as the CMAKE\_FOLDER variable, neither worked. I have set USE\_FOLDERS to ON.

```cmake
set(USE_FOLDERS ON)
set(CMAKE_FOLDER "Temporary")
add_library(Example STATIC Example.c)
set_target_properties(Example PROPERTIES FOLDER "Temporary")

```

I manually tried adding a folder through Visual Studio as well, which added to the .sln (I used WinMerge to see the differences)…

```auto
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(NestedProjects) = preSolution
		<.vcxproj guid> = <group guid>
	EndGlobalSection

```

CMake version is 3.30.4

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [October 11, 2024, 12:12pm UTC](https://discourse.cmake.org/t/folder-target-property-not-working-in-visual-studio-2022/12759/2 "2024-10-11T12:12:27Z")

</div>

`USE_FOLDERS` is a **global property** , not a variable.
