I’ve got a vcpkg overlay port that needs its own include/MYLIBRARY folder to be added to the C++ include system paths. In CMake, I can do this easily by calling target_include_directories() for every target I provide in the port’s share/MYLIBRARY/MYLIBRARY-config.cmake file. However, using .vcxproj files to build consuming projects through Visual Studio 2022/MSBuild, I cannot find a way to add this folder to the include folders.
What I’ve tried:
- Patch files in the port: I can fix every individual
#includestatement like this, but there are simply too many files for this to be feasible, especially since they would likely need to be replaced by those of a new version at some point. - Adding the overlay port’s include files to the consuming projects’
.vcxprojor.propsfiles<IncludePath>: leads to conflict where functions are defined in both thevcpkg_installedheader file and the overlay port header file. - Adding
$(VcpkgInstalledDir)include\MYLIBRARY\to the consuming projects’<IncludePath>: I was hoping the VcpkgInstalledDir property might be available to use in the IncludePath property, but it evaluates to nothing. - Adding
$(MSBuildThisFileDirectory)vcpkg_installed\x64-windows\include\MYLIBRARY\to the consuming projects’<IncludePath>is unfortunately not viable because there are other triplets to build for.
I feel like I’m overlooking something very obvious. My ideal solution would be overlay port based, but I’ll take fixes on the consuming project side too.