# Consecutive target\_link\_libraries with and without PUBLIC

**URL:** https://discourse.cmake.org/t/consecutive-target-link-libraries-with-and-without-public/3592
**Category:** Code
**Created:** [June 18, 2021, 2:23pm UTC](https://discourse.cmake.org/t/consecutive-target-link-libraries-with-and-without-public/3592 "2021-06-18T14:23:38Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)
#### Post date: [September 3, 2021, 9:23am UTC](https://discourse.cmake.org/t/consecutive-target-link-libraries-with-and-without-public/3592/7 "2021-09-03T09:23:03Z")

</div>

Yes, it has such a default, for when `PUBLIC`/`PRIVATE` is omitted _always_. However, once you use such a keyword in one invocation, you have to use it in all of them.

The way to think about it is to consider `target_link_libraries()` to have two distinct modes of operation: plain one, and keyword-based one. You can use it just fine in either mode, but you cannot mix modes for the same consuming target.

---

_[View the full topic](https://discourse.cmake.org/t/consecutive-target-link-libraries-with-and-without-public/3592)._
