Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: Modernize exported CMake config files
The CMake configuration files exported by CommonAPI require users to add the ${COMMONAPI_INCLUDE_DIRS} variable to their project's include directories. This was done to support building against a build tree of CommonAPI by generating two different CommonAPIConfig.cmake files that defined this variable with different values. This is now no longer necessary since CMake supports the $<BUILD_INTERFACE> and $<INSTALL_INTERFACE> generator expressions which can be used to make the same distinction with only a single CommonAPIConfig.cmake file. This also allows users of CommonAPI to get the required include directories into their build by using | target_link_libraries(${target} CommonAPI) since the exported CommonAPI CMake target now has the required include directories set as a property. This is much more idiomatic for users of CMake and is thus preferred. Additionally, this enables downstream projects that build CommonAPI interface libraries to no longer care about what the CommonAPI include directories are, which simplifies writing CMake config files for them. Signed-off-by: Clemens Lang <[email protected]>
- Loading branch information