I tried both the FOLDER property as well as the CMAKE_FOLDER variable, neither worked. I have set USE_FOLDERS to ON.
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)…
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
<.vcxproj guid> = <group guid>
EndGlobalSection
CMake version is 3.30.4