To execute a steveire answer:
for the library that exports the API, we must write
target_include_directories("target_with_api" INTERFACE "path_to_api_includes")
and for a library using this API, we write
target_include_directories("api_client_target_name" PRIVATE $<TARGET_PROPERTY:"target_with_api",INTERFACE_INCLUDE_DIRECTORIES>)
where $<TARGET_PROPERTY:"target_with_api",INTERFACE_INCLUDE_DIRECTORIES>) returns us the target property assigned to the library with the API
source share