# Is it possible to see what targets are imported and how?

**URL:** https://discourse.cmake.org/t/is-it-possible-to-see-what-targets-are-imported-and-how/6252
**Category:** Usage
**Created:** [August 12, 2022, 8:35am UTC](https://discourse.cmake.org/t/is-it-possible-to-see-what-targets-are-imported-and-how/6252 "2022-08-12T08:35:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rollastre\_gmail.com](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@rollastre\_gmail.com](https://discourse.cmake.org/u/rollastre_gmail.com)
#### Post date: [August 12, 2022, 8:35am UTC](https://discourse.cmake.org/t/is-it-possible-to-see-what-targets-are-imported-and-how/6252/1 "2022-08-12T08:35:14Z")

</div>

Hi.

I have a very strange problem I am unable to solve. In a project of  
mine, I have a dependency on VulkanSceneGraph which, when built it  
produces a vsg::vsg target. VulkanSceneGraph depends on Vulkan::Vulkan.  
So when you find\_package(vsg REQUIRED) it also looks for Vulkan::Vulkan.  
In the configuration step, the find\_package(vsg REQUIRED) call doesn’t  
complain. But when in generation step it fails saying the following

CMake Error at /lib/cmake/vsg/vsgTargets.cmake:56 (set\_target\_properties):  
The link interface of target “vsg::vsg” contains:

```
 Vulkan::Vulkan

```

but the target was not found. Possible reasons include:

```
 * There is a typo in the target name.
 * A find_package call is missing for an IMPORTED target.
 * An ALIAS target is missing.

```

The contents of vsgTargets.cmake in line 56 are:

53: # Create imported target vsg::vsg  
54: add\_library(vsg::vsg STATIC IMPORTED)  
55:  
56: set\_target\_properties(vsg::vsg PROPERTIES  
57: INTERFACE\_INCLUDE\_DIRECTORIES “${\_IMPORT\_PREFIX}/include”  
58: INTERFACE\_LINK\_LIBRARIES  
“Vulkan::Vulkan;Threads::Threads;glslang::MachineIndependent;glslang::OSDependent;glslang::OGLCompiler;glslang::SPIRV;glslang::GenericCodeGen;glslang::SPIRV-Tools-opt;glslang::SPIRV-Tools”  
59: )

I can’t really understand why this fails. I wonder if Vulkan::Vulkan  
doesn’t actually exist and something else is created/imported like just  
Vulkan. Hence my question. Is there a way to debug CMake internals so  
that we can see what targets are in play when configuring and generating?

Otherwise, any other suggestion about how to debug/fix this or to  
understand what is going on here is very much appreciated.

Thank you!

---

<div class="post-metadata">

### Author: ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)
#### Post date: [August 12, 2022, 8:30pm UTC](https://discourse.cmake.org/t/is-it-possible-to-see-what-targets-are-imported-and-how/6252/2 "2022-08-12T20:30:09Z")

</div>

You can pass `--debug-find` to `cmake` to get extra details about what `find_package(vsg REQUIRED)` does.

---

<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: [August 17, 2022, 8:05pm UTC](https://discourse.cmake.org/t/is-it-possible-to-see-what-targets-are-imported-and-how/6252/3 "2022-08-17T20:05:30Z")

</div>

The config file for `vsg` should include `find_package(Vulkan)` in some way. The `find_dependency` command from the `FindDependencyMacro` module is probably of interest here.
