Include path pollution
I’m building my project with cryptopp using FetchContent:
FetchContent_Declare(
cryptopp_cmake
GIT_REPOSITORY https://github.com/abdes/cryptopp-cmake.git
)
set(CRYPTOPP_BUILD_TESTING OFF)
FetchContent_MakeAvailable(cryptopp_cmake)
target_link_libraries(some_thing PRIVATE ... cryptopp::cryptopp ...)
This seems to add _deps/cryptopp_cmake-build/cryptopp to the include paths, which means if I #include <zlib.h> it includes the zlib.h from cryptopp, instead of the header from the actual zlib. (Actually I don’t use zlib.h but another dependency does, and it’s including the wrong header.) Is this the intended behavior?
Not surprising as the includes are not reachable otherwise. I can't check here atm. would it work if you remove this line?
Addendum: Or the one after that. I know I've added them, but I'm pretty sure source_dir plus the Prefix in your code should be enough.
Not surprising as the includes are not reachable otherwise. I can't check here atm. would it work if you remove this line?
Yes! Removing this line worked for me.