# Reduce number of targets in IDEs

**URL:** https://discourse.cmake.org/t/reduce-number-of-targets-in-ides/7163
**Category:** Usage
**Tags:** os:windows, os:macos
**Created:** [December 30, 2022, 12:07pm UTC](https://discourse.cmake.org/t/reduce-number-of-targets-in-ides/7163 "2022-12-30T12:07:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![edvn0](https://discourse.cmake.org/user_avatar/discourse.cmake.org/edvn0/32/3045_2.png) [@edvn0](https://discourse.cmake.org/u/edvn0)
#### Post date: [December 30, 2022, 12:07pm UTC](https://discourse.cmake.org/t/reduce-number-of-targets-in-ides/7163/1 "2022-12-30T12:07:37Z")

</div>

I typically use (git) submodules into third party libraries I need for my projects. Most of the time, these third party libraries provide several targets, and for my current project, I have 8 submodules. This results in 87 targets which Visual Studio needs to load and unload, 87 schemas for Xcode to load an manage, etc etc.

As an example, SPIRV-Cross from the Khronos group generates at least 14 targets, but I only need the statically linked library. I do understand that this statically linked library depends on other things, but I never want to build them separately.

Furthermore, I **never** rebuild the third party libraries if I don’t do a clean build or change build type from Debug to RelWithDebInfo or back.

Is there a CMake-y way to either suppress or, preferably, remove, **unnecessary** targets?

You’ll have to forgive me if I come off as uninitiated, but even as an intermediate level cpp-programmer I find, at times, that CMake is difficult. Thank you.

---

<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: [December 30, 2022, 1:53pm UTC](https://discourse.cmake.org/t/reduce-number-of-targets-in-ides/7163/2 "2022-12-30T13:53:33Z")

</div>

There’s nothing really CMake knows about this. I think the namespacing proposal might be able to help someday, but as far as CMake knows, those targets are part of your project too.

I’ll note that not every project is set up to be included via `add_subdirectory`; projects which are may have options you can set to hide “internal” details (though beware how they may differ from “official” setups and tested scenarios).
