Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Modernize exported CMake config files #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Feb 11, 2019

  1. cmake: Drop trailing whitespace

    Signed-off-by: Clemens Lang <[email protected]>
    Clemens Lang committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    d3e6606 View commit details
    Browse the repository at this point in the history
  2. 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]>
    Clemens Lang committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    5f0347e View commit details
    Browse the repository at this point in the history