# Emulation the CMake 3.25 SYSTEM target and directory property

**URL:** https://discourse.cmake.org/t/emulation-the-cmake-3-25-system-target-and-directory-property/7586
**Category:** Usage
**Created:** [March 2, 2023, 10:15am UTC](https://discourse.cmake.org/t/emulation-the-cmake-3-25-system-target-and-directory-property/7586 "2023-03-02T10:15:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![etiennemlb](https://discourse.cmake.org/user_avatar/discourse.cmake.org/etiennemlb/32/3147_2.png) [@etiennemlb](https://discourse.cmake.org/u/etiennemlb)
#### Post date: [March 2, 2023, 10:15am UTC](https://discourse.cmake.org/t/emulation-the-cmake-3-25-system-target-and-directory-property/7586/1 "2023-03-02T10:15:12Z")

</div>

CMake 3.25 added the [SYSTEM](https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html) directory property one can add to `add_subdirectory()` and `FetchContent_Declare` and the [SYSTEM](https://cmake.org/cmake/help/latest/prop_dir/SYSTEM.html) target property.

I use a library that has a conflicting compilation flag standard leading to a multitude of warnings leaking from the headers. **I would like to emulate or reproduce the directory `SYSTEM` property**. Or at least, silence the warnings, exclusively for the headers of this library (i.e., use something like `-isystem`). I could use `#pragma` shenanigans but I’m of the opinion that it should be handled by the build system.

The library producing the warnings is imported using `FetchContent_Declare`.

Ideally the solution would work with CMake 3.20. It should rely on CMake and not user (me) specified compiler flags.

`An error occurred: Sorry, new users can only put 2 links in a post.` here is the rest of the sources:  
`FetchContent_Declare`: cmakeorg/cmake/help/latest/module/FetchContent.html#command:fetchcontent\_declare  
`add_subdirectory()`: cmakeorg/cmake/help/latest/command/add\_subdirectory.html#command:add\_subdirectory
