target_include_directories overwrite the previous setup
Setup: CMake 3.15.4 + Ninja.
Background:
We're using protobuf_generate()
function provided by protobuf 3.10's cmake config file.
It will add some -I <dir>
for the target.
And then we call target_include_directories()
to add a few more.
In cmake 3.15.4, we noticed that the behavior is broken.
Our target_include_directories()
call overwrite protobuf's -I
.
I also tried to call target_include_directories()
twice:
target_include_directories(my_target PUBLIC "A/.." "A")
target_include_directories(my_target PUBLIC "A/..")
and only -IA/..
appears in the final command, with compile errors for not able to find files directly under A.