# INTERFACE\_INCLUDE\_DIRECTORIES from Imported Target can not be seen in Visual Studio

**URL:** https://discourse.cmake.org/t/interface-include-directories-from-imported-target-can-not-be-seen-in-visual-studio/6507
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [September 19, 2022, 10:44am UTC](https://discourse.cmake.org/t/interface-include-directories-from-imported-target-can-not-be-seen-in-visual-studio/6507 "2022-09-19T10:44:46Z")
**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: [September 19, 2022, 10:44am UTC](https://discourse.cmake.org/t/interface-include-directories-from-imported-target-can-not-be-seen-in-visual-studio/6507/1 "2022-09-19T10:44:46Z")

</div>

Consider this cmake scripts:

```auto
    find_package(Nxx 1.0.0 REQUIRED COMPONENTS Math IO)

    add_compile_definitions(NXX)

    target_link_librariesSolver PRIVATE Nxx::Math)
    target_link_librariesSolver PRIVATE Nxx::IO)

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

```

the MathTargets.cmake of package Nxx contains this contents:

```auto
if(NOT CMAKE_VERSION VERSION_LESS "3.23.0")
  target_sources(Math
    INTERFACE
      FILE_SET "HEADERS"
      TYPE "HEADERS"
      BASE_DIRS "${_IMPORT_PREFIX}/xx/math"
      FILES "${_IMPORT_PREFIX}/xx/math/Common.h" "${_IMPORT_PREFIX}/xx/math/Constants.h" 
  )
endif()

```

With CMake 3.23.0,  
run command “cmake -G"Visual Studio 16” … " and I will find the path, after “${\_IMPORT\_PREFIX}/xx/math” expansion, in the field of “Additional Include Directories” of Visual Studio.

With CMake 3.24.1,  
the same cmake scripts and command, I can NOT find the path in the field of “Additional Include Directories” of Visual Studio.

With both of them, I can find the path of “${\_IMPORT\_PREFIX}/xx/math” expansion in test\_debug\_genex.log.

By the way, both of CMake 3.23.0 and CMake 3.24.1 can generate a build system to build correctly.

Is it a regression for this issuse?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [October 17, 2022, 8:59pm UTC](https://discourse.cmake.org/t/interface-include-directories-from-imported-target-can-not-be-seen-in-visual-studio/6507/2 "2022-10-17T20:59:13Z")

</div>

@brad.king any thoughts as to what might have changed here?

---

<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 18, 2022, 6:44am UTC](https://discourse.cmake.org/t/interface-include-directories-from-imported-target-can-not-be-seen-in-visual-studio/6507/3 "2022-10-18T06:44:50Z")

</div>

I really appreciate everything you’ve done.

I do believe this topic is relative to: [Visual Studio does not show the pathes in INCLUDE\_DIRECTORIES](https://discourse.cmake.org/t/visual-studio-does-not-show-the-pathes-in-include-directories/6635).

The FILE\_SET’s BASE\_DIR might be set as a SYSTEM path.
