# How to enable precompiled headers with existing header file.

**URL:** https://discourse.cmake.org/t/how-to-enable-precompiled-headers-with-existing-header-file/13197
**Category:** Code
**Created:** [December 13, 2024, 8:13pm UTC](https://discourse.cmake.org/t/how-to-enable-precompiled-headers-with-existing-header-file/13197 "2024-12-13T20:13:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![aseryukov](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@aseryukov](https://discourse.cmake.org/u/aseryukov)
#### Post date: [December 13, 2024, 8:13pm UTC](https://discourse.cmake.org/t/how-to-enable-precompiled-headers-with-existing-header-file/13197/1 "2024-12-13T20:13:39Z")

</div>

Hello,

I have a large-ish C/C++ code base that uses static pre-compiled headers MSVC-style. The header file exists in the source tree and C files include it explicitly, as needed. Is there a way to accommodate this structure with cmake? In particular, I’d like to avoid build-time source code generation (i.e. cmake\_pch.hxx) and forced includes, if possible.

Thank you for your help!
