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

build: cmake: fix target_include_directories #259

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

fcelda
Copy link
Contributor

@fcelda fcelda commented Apr 27, 2021

The target_include_directories option doesn't work as expected. I noticed that when trying to include the libmaxminddb as a CMake subdirectory into a different project.

Here is a simple reproducer:

project(reproducer)
add_subdirectory("libmaxminddb")

CMake will fail on building that project with the following error:

CMake Error in libmaxminddb/CMakeLists.txt:
  Target "maxminddb" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/tmp/repro/libmaxminddb/"

  which is prefixed in the build directory.

The problem seems to be two-fold:

  • The variable in $<BUILD_INTERFACE:${VAR}> must be a single path.
  • The paths provided for build interface must not be relative.

The attached patch fixes the problem.

Copy link
Member

@oschwald oschwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@oschwald oschwald merged commit 588fdc7 into maxmind:main Apr 27, 2021
@fcelda fcelda deleted the fix-include-directories branch April 28, 2021 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants