# add\_library and target\_include\_directories

**URL:** https://discourse.cmake.org/t/add-library-and-target-include-directories/9482
**Category:** Usage
**Tags:** tool:cmake
**Created:** [November 22, 2023, 3:50am UTC](https://discourse.cmake.org/t/add-library-and-target-include-directories/9482 "2023-11-22T03:50:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sea\_Sea](https://discourse.cmake.org/user_avatar/discourse.cmake.org/sea_sea/32/4025_2.png) [@Sea\_Sea](https://discourse.cmake.org/u/Sea_Sea)
#### Post date: [November 22, 2023, 3:50am UTC](https://discourse.cmake.org/t/add-library-and-target-include-directories/9482/1 "2023-11-22T03:50:40Z")

</div>

> <https://github.com/paullouisageneau/libdatachannel/blob/f434804c94841ed801cb96b5a7770f1f1f894276/CMakeLists.txt#L258>

> <https://github.com/paullouisageneau/libdatachannel/blob/f434804c94841ed801cb96b5a7770f1f1f894276/CMakeLists.txt#L282>

`add_library` already use the `${CMAKE_CURRENT_SOURCE_DIR}/include/rtc`  
why does `target_include_directories` do it again?

---

<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: [November 22, 2023, 2:28pm UTC](https://discourse.cmake.org/t/add-library-and-target-include-directories/9482/2 "2023-11-22T14:28:29Z")

</div>

`add_library` just lists files for the target; there’s no `-I` path implied for any of them.
