# add\_subdirectory() for Git Submodules without CMakeLists.txt?

**URL:** https://discourse.cmake.org/t/add-subdirectory-for-git-submodules-without-cmakelists-txt/14085
**Category:** Usage
**Tags:** gen:ninja
**Created:** [May 13, 2025, 5:58pm UTC](https://discourse.cmake.org/t/add-subdirectory-for-git-submodules-without-cmakelists-txt/14085 "2025-05-13T17:58:03Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![bmcdonnell-fb](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bmcdonnell-fb/32/5561_2.png) [@bmcdonnell-fb](https://discourse.cmake.org/u/bmcdonnell-fb)
#### Post date: [May 17, 2025, 3:38pm UTC](https://discourse.cmake.org/t/add-subdirectory-for-git-submodules-without-cmakelists-txt/14085/7 "2025-05-17T15:38:43Z")

</div>

> [@LegalizeAdulthood](#):
>
> I just thought I’d toss out these two alternatives as other options for you to consider.

Thanks for the additional info.

> [@LegalizeAdulthood](#):
>
> Generally speaking both the FetchContent approach and the vcpkg approach assume relatively stable dependencies.

That’s not really the case for this project. The submodules do require occasional modification–sometimes merely as a one-off for testing (not committed).

I fleshed my idea out a bit in [RFC: inject CMakeLists.txt to add\_subdirectory()](https://discourse.cmake.org/t/feature-request-inject-cmakelists-txt-to-add-subdirectory/14108).

---

_[View the full topic](https://discourse.cmake.org/t/add-subdirectory-for-git-submodules-without-cmakelists-txt/14085)._
