# Marking ITK includes as SYSTEM

**URL:** https://discourse.itk.org/t/marking-itk-includes-as-system/910
**Category:** Engineering
**Created:** [May 8, 2018, 2:18pm UTC](https://discourse.itk.org/t/marking-itk-includes-as-system/910 "2018-05-08T14:18:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![spinicist](https://discourse.itk.org/user_avatar/discourse.itk.org/spinicist/32/183_2.png) [@spinicist](https://discourse.itk.org/u/spinicist)
#### Post date: [May 8, 2018, 2:18pm UTC](https://discourse.itk.org/t/marking-itk-includes-as-system/910/1 "2018-05-08T14:18:08Z")

</div>

Hello,

I have recently discovered the `SYSTEM` flag for `include_directories()` ([https://cmake.org/cmake/help/v3.0/command/include\_directories.html](https://cmake.org/cmake/help/v3.0/command/include_directories.html)). I’ve added this to my main CMake file for all external libraries that use `include_directories` so that I can enable `-Wall -Wpedantic -Wextra` and get warnings about my code, but not worry about external libraries.

However, I can’t see how to do this for ITK, because for ITK I have `include( $ITK_USE_FILE )` instead of `include_directories`. Sadly, ITK does throw up a lot of warnings with `-Wpedantic`, e.g.:

```auto
../External/ITK/Modules/Core/Common/include/itkMath.h:204:40: warning: extra ; [-Wpedantic]
 itkTemplateFloatingToIntegerMacro(Ceil);

```

This is with v4.13.0 checked-out, I haven’t had a chance to move to ITK 5 yet.

---

<div class="post-metadata">

### Author: ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)
#### Post date: [May 8, 2018, 2:33pm UTC](https://discourse.itk.org/t/marking-itk-includes-as-system/910/2 "2018-05-08T14:33:22Z")

</div>

@spinicist I don’t think I can help, but I’m just wondering:

1. Does the CMake SYSTEM flag translate to `-system`, in your makefiles? [https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html#Directory-Options](https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html#Directory-Options)

2. Do you do `#include "file"` or `#include < file >`, when you #include an ITK header file? It might be that `#include < file >` works best, for the compiler to recognize the ITK headers as system headers.

Anyway, I hope that someone else can help you any further!

---

<div class="post-metadata">

### Author: ![spinicist](https://discourse.itk.org/user_avatar/discourse.itk.org/spinicist/32/183_2.png) [@spinicist](https://discourse.itk.org/u/spinicist)
#### Post date: [May 8, 2018, 3:37pm UTC](https://discourse.itk.org/t/marking-itk-includes-as-system/910/3 "2018-05-08T15:37:09Z")

</div>

Thanks @Niels_Dekker

1. Yes, I think this is what `SYSTEM` does.
2. I hadn’t thought about “” versus \<\>. To be honest I am a bit sloppy about which I use, and I thought that these days there is little difference between them (it doesn’t seem to matter which I use, the compiler finds the right files)

I may be wrong on both points if others wish to enlighten me!
