# Objects of target "X" referenced but is not an OBJECT library

**URL:** https://discourse.cmake.org/t/objects-of-target-x-referenced-but-is-not-an-object-library/3857
**Category:** Usage
**Created:** [July 31, 2021, 3:37pm UTC](https://discourse.cmake.org/t/objects-of-target-x-referenced-but-is-not-an-object-library/3857 "2021-07-31T15:37:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Wirtos](https://discourse.cmake.org/user_avatar/discourse.cmake.org/wirtos/32/1081_2.png) [@Wirtos](https://discourse.cmake.org/u/Wirtos)
#### Post date: [July 31, 2021, 3:37pm UTC](https://discourse.cmake.org/t/objects-of-target-x-referenced-but-is-not-an-object-library/3857/1 "2021-07-31T15:37:47Z")

</div>

I have a library that uses another third-party cmake subproject, which has library target X. In newer cmake versions (3.16+) I’m able to use $\<TARGET\_OBJECTS:X\> in order to make third party library an embedded part of my lib. The third-party library has no OBJECT targets and my approach seems to work fine, but fails on cmake 3.12. What version I can assume this to work on or what approach should I use for such use-cases?

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [July 31, 2021, 4:12pm UTC](https://discourse.cmake.org/t/objects-of-target-x-referenced-but-is-not-an-object-library/3857/2 "2021-07-31T16:12:22Z")

</div>

See differences between:

- [https://cmake.org/cmake/help/v3.14/manual/cmake-generator-expressions.7.html](https://cmake.org/cmake/help/v3.14/manual/cmake-generator-expressions.7.html)
- [https://cmake.org/cmake/help/v3.15/manual/cmake-generator-expressions.7.html](https://cmake.org/cmake/help/v3.15/manual/cmake-generator-expressions.7.html)

So it seems the requirements have been relaxed in 3.15.

---

<div class="post-metadata">

### Author: ![Wirtos](https://discourse.cmake.org/user_avatar/discourse.cmake.org/wirtos/32/1081_2.png) [@Wirtos](https://discourse.cmake.org/u/Wirtos)
#### Post date: [July 31, 2021, 4:24pm UTC](https://discourse.cmake.org/t/objects-of-target-x-referenced-but-is-not-an-object-library/3857/3 "2021-07-31T16:24:30Z")

</div>

Oh, thanks, didn’t think to look for requirements in generator expressions specifically. Looks like I should drop older cmake versions then.
