# Hiding files generated by UNITY\_BUILD in Visual Studio

**URL:** https://discourse.cmake.org/t/hiding-files-generated-by-unity-build-in-visual-studio/11130
**Category:** Usage
**Created:** [June 29, 2024, 3:26pm UTC](https://discourse.cmake.org/t/hiding-files-generated-by-unity-build-in-visual-studio/11130 "2024-06-29T15:26:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![KStocky](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kstocky/32/4707_2.png) [@KStocky](https://discourse.cmake.org/u/KStocky)
#### Post date: [June 29, 2024, 3:26pm UTC](https://discourse.cmake.org/t/hiding-files-generated-by-unity-build-in-visual-studio/11130/1 "2024-06-29T15:26:12Z")

</div>

Hi all!

I just started configuring my project to build using UNITY\_BUILD and it is great! However, in Visual Studio, the generated source files appear in the “SourceFiles” filter like any other unfiltered source file. I would like to hide them from the solution explorer entirely.

I have not been able to come up with a way of doing this, unfortunately. I have been able to group them in their own named filter using [`source_group`](https://cmake.org/cmake/help/latest/command/source_group.html) with a regular expression like so:

`source_group(UnityBuildFiles REGULAR_EXPRESSION ".+_cxx.cxx")`

This is certainly an improvement over them just appearing in the default filter. But it would be better if there was a way to just hide them entirely. Has anyone tried to do something similar to hide away UNITY\_BUILD files or generated files in general?

Cheers,  
Keith

---

<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: [July 17, 2025, 4:16pm UTC](https://discourse.cmake.org/t/hiding-files-generated-by-unity-build-in-visual-studio/11130/2 "2025-07-17T16:16:17Z")

</div>

Is it possible to make a VS project that builds files that don’t show up in the project tree? I would be surprised…but if that can be done and an example project provided, we can look at how CMake could generate it.
