# Include\_directories() add a path that include "-", compile\_commands.json don't include this path, why?

**URL:** https://discourse.cmake.org/t/include-directories-add-a-path-that-include-compile-commands-json-dont-include-this-path-why/10614
**Category:** Usage
**Tags:** os:windows
**Created:** [April 9, 2024, 6:53am UTC](https://discourse.cmake.org/t/include-directories-add-a-path-that-include-compile-commands-json-dont-include-this-path-why/10614 "2024-04-09T06:53:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Leeto1970](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@Leeto1970](https://discourse.cmake.org/u/Leeto1970)
#### Post date: [April 9, 2024, 6:53am UTC](https://discourse.cmake.org/t/include-directories-add-a-path-that-include-compile-commands-json-dont-include-this-path-why/10614/1 "2024-04-09T06:53:43Z")

</div>

as title says, when I add a absolute path in my CmakeLists.txt, generated compile\_commands.json don’t include the path.

```auto
set(INCLUDE_PATH "D:/gnuarmemb/arm-none-eabi/include")
include_directories(${INCLUDE_PATH})

```

This path is not appeared in compile\_commands.json

```auto
set(INCLUDE_PATH "D:/gnuarmemb/armnoneeabi/include")
include_directories(${INCLUDE_PATH})

```

This path is appeared in compile\_commands.json

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [April 9, 2024, 9:33am UTC](https://discourse.cmake.org/t/include-directories-add-a-path-that-include-compile-commands-json-dont-include-this-path-why/10614/2 "2024-04-09T09:33:17Z")

</div>

> [@Leeto1970](#):
>
> `"D:/gnuarmemb/arm-none-eabi/include"`

- which generator are you using on windows?
- and which cmake version?
- why do you not use a toolchain for your cross compiler?

---

<div class="post-metadata">

### Author: ![Leeto1970](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@Leeto1970](https://discourse.cmake.org/u/Leeto1970)
#### Post date: [April 10, 2024, 7:17am UTC](https://discourse.cmake.org/t/include-directories-add-a-path-that-include-compile-commands-json-dont-include-this-path-why/10614/3 "2024-04-10T07:17:15Z")

</div>

Sorry for I’m not showing all information.  
1.I use “MinGW Makefiles” generator  
2.CMAKE version I used is 3.26.4  
3.Do you mean specify “CMAKE\_TOOLCHAIN\_FILE”? I had specify a toolchain for my project.  
thank you a lot.

---

<div class="post-metadata">

### Author: ![Leeto1970](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@Leeto1970](https://discourse.cmake.org/u/Leeto1970)
#### Post date: [April 11, 2024, 6:17am UTC](https://discourse.cmake.org/t/include-directories-add-a-path-that-include-compile-commands-json-dont-include-this-path-why/10614/4 "2024-04-11T06:17:45Z")

</div>

I’m already known why. When I use cross compiler, and I specify toolchain(arm-none-eabi-gcc is in path “D:/gnuarmemb/arm-none-eabi/bin”) , CMAKE thinks the “D:/gnuarmemb/arm-none-eabi/include” is default search path, so the path not appear in compile\_commands.json file. When I change folder name, cmake thinks the path is what I want to search . That’s all.
