Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to include directories in target _ include _ directories?


Asked by Vicente Gardner on Dec 05, 2021 FAQ



If SYSTEM is used together with PUBLIC or INTERFACE, the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property will be populated with the specified directories. Arguments to target_include_directories may use "generator expressions" with the syntax $<...>.
Next,
A target's INCLUDE_DIRECTORIES property contains the include directories for that target. Since you have two targets, LibraryA and LibraryB, we have to call it twice. Then, we can concatenate the list of include directories together using foreach ().
Also Know, The include directories are added to the INCLUDE_DIRECTORIES directory property for the current CMakeLists file. They are also added to the INCLUDE_DIRECTORIES target property for each target in the current CMakeLists file. The target property values are the ones used by the generators.
And,
A directory gets its initial value from its parent directory if it has one. The initial value of the INCLUDE_DIRECTORIES target property comes from the value of this property.
Additionally,
199 include_directories(x/y)affects directory scope. All targets in this CMakeList, as well as those in all subdirectories added after the point of its call, will have the path x/yadded to their include path.