# Disable Fetch Content lib and header file Installation

**URL:** https://discourse.cmake.org/t/disable-fetch-content-lib-and-header-file-installation/13646
**Category:** Code
**Created:** [February 27, 2025, 9:07am UTC](https://discourse.cmake.org/t/disable-fetch-content-lib-and-header-file-installation/13646 "2025-02-27T09:07:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![acraft](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/34f0e0/32.png) [@acraft](https://discourse.cmake.org/u/acraft)
#### Post date: [February 27, 2025, 9:07am UTC](https://discourse.cmake.org/t/disable-fetch-content-lib-and-header-file-installation/13646/1 "2025-02-27T09:07:38Z")

</div>

Hello,

I use FetchContent and can build and link the libraries I need. When I install my project, I would like to skip or control library installations.

For the following example, what is the right way to skip library and header installation of the fmt?

```auto
# 
include(FetchContent)

FetchContent_Declare(fmt ...)
FetchContent_MakeAvailable(fmt)

```

Note: I use all the FetchContent usage in a third\_party.cmake file, which I include in the main CMake file.

Thanks

---

<div class="post-metadata">

### Author: ![acraft](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/34f0e0/32.png) [@acraft](https://discourse.cmake.org/u/acraft)
#### Post date: [February 27, 2025, 10:32am UTC](https://discourse.cmake.org/t/disable-fetch-content-lib-and-header-file-installation/13646/2 "2025-02-27T10:32:47Z")

</div>

UPDATE:

Adding EXCLUDE\_FROM\_ALL at the end of FetchContent\_Declare() worked. I no longer see headers and libs. For shared libs, I control what to install by using install().

Please provide feedback if there is a better way to handle this.

Thanks
