When is the vcpkg includes directory added to CMake generator output? #26518
Replies: 2 comments 2 replies
-
I've found a similar problem, when using manifest mode and including the vcpkg toolchain, subdirectories projects end up including by default all of the top level project dependencies. There's no need to use "target_include_directories" and every project can access every include. Is there a way to avoid this? |
Beta Was this translation helpful? Give feedback.
-
The headers in |
Beta Was this translation helpful? Give feedback.
-
I'm using vcpkg as a submodule of a CMake project, with the vcpkg toolchain file. I'm also generating with Visual Studio but I expect that might not be relevant.
I have been going through my CMakeLists.txt files and haven't found a single place where I'm bringing in any of the include paths of vcpkg vendored libraries, yet the
vcpkg_installed/<triplet>/include
path is getting added to my generator output. When is this added? And more importantly, is it possible to control where in the list of include paths it's added? I have an issue where I need to keep our common includes path for non-vcpkg vendored dependencies, but that path is getting added first and I end up getting the wrong headers.I've tried every permutation of
target_include_directories
,list(REMOVE_ITEM <bad include path>)
,list(PREPEND <vcpkg include path>)
etc. I can think of, but vcpkg's includes always end up towards the end of my include paths list.Beta Was this translation helpful? Give feedback.
All reactions