# Visual Studio does not show the pathes in INCLUDE\_DIRECTORIES

**URL:** https://discourse.cmake.org/t/visual-studio-does-not-show-the-pathes-in-include-directories/6635
**Category:** Usage
**Created:** [October 10, 2022, 10:35am UTC](https://discourse.cmake.org/t/visual-studio-does-not-show-the-pathes-in-include-directories/6635 "2022-10-10T10:35:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pei\_Wang](https://discourse.cmake.org/user_avatar/discourse.cmake.org/pei_wang/32/2777_2.png) [@Pei\_Wang](https://discourse.cmake.org/u/Pei_Wang)
#### Post date: [October 10, 2022, 10:35am UTC](https://discourse.cmake.org/t/visual-studio-does-not-show-the-pathes-in-include-directories/6635/1 "2022-10-10T10:35:55Z")

</div>

I’m wondering it is a regression:

I have a series of cmake scripts like this:

```auto
add_library(Protobuf INTERFACE)
target_include_directories(Protobuf INTERFACE ${ProtobufInclude})
// something else...

add_library(MyLib)
target_sources(MyLib INTERFACE FILE_SET HEADERS FILES ${HeaderFiles})
// something else...

target_link_libraries(MyTarget PRIVATE MyLib)

file(GENERATE OUTPUT test_debug_genex.log
    CONTENT "$<TARGET_PROPERTY:MyTarget,INCLUDE_DIRECTORIES>")

```

If I build these scripts with CMake 3.23.0 by using “cmake -G “Visual studio 16” …”

I will get a visual studio solution of which “Addination Include Directories” property contains “ProtobufInclude” and the base\_dir path of MyLib’s HeaderFiles. The Command lines do not contain any “external:I xxx”.

If I build these scripts with CMake 3.24.1 by using the same command,

The visual studio solution’s “Addination Include Directories” property only contains the path of “ProtobufInclude”.  
And the base\_dir path of MyLib’s HeaderFiles can only be found in Command lines, like “external:I MyLib’s HeaderFiles”.

The same behavious can be found by building Visual studio 2022 solution with CMake 3.24.1.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [October 10, 2022, 3:38pm UTC](https://discourse.cmake.org/t/visual-studio-does-not-show-the-pathes-in-include-directories/6635/2 "2022-10-10T15:38:57Z")

</div>

See [CMake Issue 23834](https://gitlab.kitware.com/cmake/cmake/-/issues/23834). Use VS 17.3 or higher.

---

<div class="post-metadata">

### Author: ![Pei\_Wang](https://discourse.cmake.org/user_avatar/discourse.cmake.org/pei_wang/32/2777_2.png) [@Pei\_Wang](https://discourse.cmake.org/u/Pei_Wang)
#### Post date: [October 11, 2022, 3:41am UTC](https://discourse.cmake.org/t/visual-studio-does-not-show-the-pathes-in-include-directories/6635/3 "2022-10-11T03:41:10Z")

</div>

Thanks for your help. It works now.

Btw, How to set the BASE\_DIR Path to INCLUDE\_DIRECTORIES, insteaded of SYSTEM\_INCLUDE\_DIRECTORIES?
