# Add CMakeLists.txt that only uses add\_subdirectory() to Visual Studio solution

**URL:** https://discourse.cmake.org/t/add-cmakelists-txt-that-only-uses-add-subdirectory-to-visual-studio-solution/13903
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [April 9, 2025, 9:30am UTC](https://discourse.cmake.org/t/add-cmakelists-txt-that-only-uses-add-subdirectory-to-visual-studio-solution/13903 "2025-04-09T09:30:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Andreas](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@Andreas](https://discourse.cmake.org/u/Andreas)
#### Post date: [April 9, 2025, 9:30am UTC](https://discourse.cmake.org/t/add-cmakelists-txt-that-only-uses-add-subdirectory-to-visual-studio-solution/13903/1 "2025-04-09T09:30:15Z")

</div>

We have the following structure

```auto
/libs/CMakeLists.txt
/libs/lib1/CMakeLists.txt
/libs/lib1/src/...
/libs/lib2/CMakeLists.txt
/libs/lib2/src/...

```

In `/libs/CMakeLists.txt` we only include other CMakeLists.txt files:

```auto
add_subdirectory(lib1)
add_subdirectory(lib2)

```

I’d like to have /libs/CMakeLists.txt in the Visual Studio solution. By default, there is no project that this file is added to by CMake. That means that if I do a global search for “lib1”, I won’t find the “add\_subdirectory(lib1)” line.

I’ve tried adding a dummy `add_library(libs_helper INTERFACE CMakeLists.txt)`. Other recommendations?
