# Difficulties using a third-party cmake projects: missing \<package\>\_INCLUDE\_DIR(S) (and other)

**URL:** <https://discourse.cmake.org/t/difficulties-using-a-third-party-cmake-projects-missing-package-include-dir-s-and-other/15298>\
**Category:** Code\
**Created:** [November 12, 2025, 7:04pm UTC](https://discourse.cmake.org/t/difficulties-using-a-third-party-cmake-projects-missing-package-include-dir-s-and-other/15298 "2025-11-12T19:04:14Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Post date:** [November 17, 2025, 10:30am UTC](https://discourse.cmake.org/t/difficulties-using-a-third-party-cmake-projects-missing-package-include-dir-s-and-other/15298/9 "2025-11-17T10:30:45Z")

</div>

Thanks Jakub. Mixing your proposal and [mistral codestral’s one](https://mistral.ai/fr/news/codestral) I’m getting:

```cmake
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
list(FILTER ImportedTargets INCLUDE REGEX "^${PackName}::")

if(ImportedTargets)

	# Creating the main component
	add_library(${PackName}::${PackName} INTERFACE IMPORTED)
	# Adding the found components as dependencies
	if(ImportedTargets)
		target_link_libraries(${PackName}::${PackName} INTERFACE ${ImportedTargets})
	endif()

endif()

```

---

_[View the full topic](https://discourse.cmake.org/t/difficulties-using-a-third-party-cmake-projects-missing-package-include-dir-s-and-other/15298)._
