# \[Newbie\] Help setting up my first CMakeLists.txt

**URL:** https://discourse.cmake.org/t/newbie-help-setting-up-my-first-cmakelists-txt/10608
**Category:** Usage
**Created:** [April 7, 2024, 11:46am UTC](https://discourse.cmake.org/t/newbie-help-setting-up-my-first-cmakelists-txt/10608 "2024-04-07T11:46:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RaptaG](https://discourse.cmake.org/user_avatar/discourse.cmake.org/raptag/32/4478_2.png) [@RaptaG](https://discourse.cmake.org/u/RaptaG)
#### Post date: [April 7, 2024, 11:46am UTC](https://discourse.cmake.org/t/newbie-help-setting-up-my-first-cmakelists-txt/10608/1 "2024-04-07T11:46:18Z")

</div>

I am setting up my first `CMakeLists.txt` and I can’t figure out the following:

1. How can I make `CMakeLists.txt` read only from the files included inside the (eg.) `src/` folder, where `src/` is a folder inside the same directory `CMakeLists.txt` is?
2. Can I include an entire folder in `add_library()`, which only contains `.hpp` files?
3. Should I add `${PROJECT_NAME}` in `add_library(<name>)` or something else?
4. How can I determine the minimum CMake and C++ version for my project?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [April 7, 2024, 5:15pm UTC](https://discourse.cmake.org/t/newbie-help-setting-up-my-first-cmakelists-txt/10608/2 "2024-04-07T17:15:58Z")

</div>

Dit you read the CMake introduction or tutorials?

There are good books about cmake, i.e. [Professional CMake: A Practical Guide - 18th Edition](https://crascit.com/professional-cmake/)

Do you know [GitHub - friendlyanon/cmake-init: The missing CMake project initializer](https://github.com/friendlyanon/cmake-init?tab=readme-ov-file#readme)

An example for an complex header only library is [asio MR#3](https://github.com/ClausKlein/asio/pull/3)
