# AdditionalIncludeDirectories are missed in vcxproj

**URL:** https://discourse.cmake.org/t/additionalincludedirectories-are-missed-in-vcxproj/5826
**Category:** Usage
**Created:** [June 8, 2022, 7:24pm UTC](https://discourse.cmake.org/t/additionalincludedirectories-are-missed-in-vcxproj/5826 "2022-06-08T19:24:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![matwey](https://discourse.cmake.org/user_avatar/discourse.cmake.org/matwey/32/198_2.png) [@matwey](https://discourse.cmake.org/u/matwey)
#### Post date: [June 8, 2022, 7:24pm UTC](https://discourse.cmake.org/t/additionalincludedirectories-are-missed-in-vcxproj/5826/1 "2022-06-08T19:24:56Z")

</div>

Hello,

I am using GitHub Actions for my open-source project: [GitHub - matwey/libopenvizsla at github-actions](https://github.com/matwey/libopenvizsla/tree/github-actions)  
While trying to fix the build for Windows, I’ve faced an issue which I could not reproduce in my environment.  
Both environments uses cmake 3.23, and same vcpkg versions are in use. However the environments produce different `vcxproj` files for the same `CMakeLists.txt`.

Critical difference that cmake at GitHub doesn’t use include paths for the resource compiler while local cmake does:

```auto
     <ResourceCompile>
       <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;_XOPEN_SOURCE;_XOPEN_SOURCE_EXTENDED;CMAKE_INTDIR=\"Release\";openvizsla_EXPORTS</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>D:\a\libopenvizsla\libopenvizsla\include;D:\a\libopenvizsla\libopenvizsla\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>C:\Users\User\libopenvizsla\include;C:\Users\User\libopenvizsla\build;C:\Users\User\vcpkg\installed\x64-windows\include\libusb-1.0;C:\Users\User\vcpkg\installed\x64-windows\include\libftdi1;C:\Users\User\vcpkg\installed\x64-windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>

```

This leads to resource compilation failure due to required header file cannot be opened.

Include paths for comping the code are file in both cases:

```auto
     <ClCompile>
- <AdditionalIncludeDirectories>C:\vcpkg\installed\x64-windows\debug\lib\pkgconfig\..\..\..\include\libusb-1.0;C:\vcpkg\installed\x64-windows\debug\lib\pkgconfig\..\..\..\include\libftdi1;C:\vcpkg\installed\x64-windows\debug\lib\pkgconfig\..\..\..\include;D:\a\libopenvizsla\libopenvizsla\include;D:\a\libopenvizsla\libopenvizsla\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>C:\Users\User\libopenvizsla\include;C:\Users\User\libopenvizsla\build;C:\Users\User\vcpkg\installed\x64-windows\include\libusb-1.0;C:\Users\User\vcpkg\installed\x64-windows\include\libftdi1;C:\Users\User\vcpkg\installed\x64-windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <ExceptionHandling>
@@ -272,10 +272,10 @@
     </ClCompile>

```

How could I debug this issue further? Because I have no idea what could be wrong here.

---

<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: [June 9, 2022, 3:19pm UTC](https://discourse.cmake.org/t/additionalincludedirectories-are-missed-in-vcxproj/5826/2 "2022-06-09T15:19:23Z")

</div>

One machine seems to have `../` in those paths. There are situations that can confuse CMake in the presence of junctions or reparse points. Are you sure the vcpkg environments are the same on these two machines?

---

<div class="post-metadata">

### Author: ![matwey](https://discourse.cmake.org/user_avatar/discourse.cmake.org/matwey/32/198_2.png) [@matwey](https://discourse.cmake.org/u/matwey)
#### Post date: [June 9, 2022, 5:26pm UTC](https://discourse.cmake.org/t/additionalincludedirectories-are-missed-in-vcxproj/5826/3 "2022-06-09T17:26:18Z")

</div>

Thank you. Your hint was very helpful. I think I’ve found the difference. GitHub actions has pkg-config installed. My `CMakeLists.txt` supports both `pkg-config` for UNIX systems and fallback to `find_library` for Windows. However, `pkg-config` produces unnormalized paths on Windows.

---

<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: [June 9, 2022, 5:41pm UTC](https://discourse.cmake.org/t/additionalincludedirectories-are-missed-in-vcxproj/5826/4 "2022-06-09T17:41:52Z")

</div>

In that case, it might be that `pkg-config` is causing the GHA instance to go down some wrong assumptions about installation layouts and such. You can either update how you find your dependencies (i.e., not assume that `pkg-config` is the best way if it exists) or make it support whatever `vcpkg` is doing with `.pc` files here.

---

<div class="post-metadata">

### Author: ![matwey](https://discourse.cmake.org/user_avatar/discourse.cmake.org/matwey/32/198_2.png) [@matwey](https://discourse.cmake.org/u/matwey)
#### Post date: [June 9, 2022, 6:20pm UTC](https://discourse.cmake.org/t/additionalincludedirectories-are-missed-in-vcxproj/5826/5 "2022-06-09T18:20:42Z")

</div>

Why does `ClCompile` understand this paths while `ResourceCompile` doesn’t? Isn’t this should be fixed inside CMake?

---

<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: [June 9, 2022, 7:15pm UTC](https://discourse.cmake.org/t/additionalincludedirectories-are-missed-in-vcxproj/5826/6 "2022-06-09T19:15:12Z")

</div>

🤷 `rc.exe` is a different tool from `cl.exe`. I can’t speak to why one might interpret paths differently than the other.
