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

manif_INCLUDE_DIRS has duplicate path #85

Open
joansola opened this issue May 25, 2019 · 2 comments
Open

manif_INCLUDE_DIRS has duplicate path #85

joansola opened this issue May 25, 2019 · 2 comments

Comments

@joansola
Copy link
Collaborator

joansola commented May 25, 2019

The cmake code:

FIND_PACKAGE(manif REQUIRED)
IF(manif_FOUND)
    MESSAGE(STATUS "manif Library FOUND!")
    MESSAGE(STATUS "manif_INCLUDE_DIRS=" ${manif_INCLUDE_DIRS})
ELSEIF(manif_FOUND)
    MESSAGE(STATUS "manif Library NOT FOUND!")
ENDIF(manif_FOUND)

produces

-- manif Library FOUND!
-- manif_INCLUDE_DIRS=/usr/local/include/usr/local/include

where /usr/local/include is appended twice! Then, the line

TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM ${manif_INCLUDE_DIRS})

produces not surprisingly

CMake Error at CMakeLists.txt:529 (TARGET_INCLUDE_DIRECTORIES):
  TARGET_INCLUDE_DIRECTORIES called with invalid arguments
@artivis
Copy link
Owner

artivis commented May 25, 2019

This is surprising because I have packages that include manif without any issues. But after checking I do have this duplication too. I'll investigate.

In the meantime, mind that you can also link manif as if it is a library:

target_link_libraries(${PROJECT_NAME} INTERFACE MANIF::manif)

@artivis
Copy link
Owner

artivis commented May 25, 2019

This 'duplication' arise from the fact that manif export both a BUILD_INTERFACE and an INSTALL_INTERFACE in its target_include_directories that is later used to populate manif_INCLUDE_DIRS. Not sure if this is actually an issue/bad practice. It still should work fine tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants