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

Target is not correctly being exported, missing INTERFACE_INCLUDE_DIRECTORIES. #91

Open
Levi-Armstrong opened this issue Oct 22, 2020 · 1 comment

Comments

@Levi-Armstrong
Copy link

I ran into an issue where my project could not find the header console_bridge/console_bridge.h event though find_package was able to find the package. After further investigation I found that the target console_bridge::console_bridge provided by does not set the targets INTERFACE_INCLUDE_DIRECTORIES, but it does set the cmake variable console_bridge_INCLUDE_DIRS.

Reproduce:

find_package(console_bridge REQUIRED)
get_target_property(GET_INCLUDES console_bridge::console_bridge INTERFACE_INCLUDE_DIRECTORIES)
message(AUTHOR_WARNING "console_bridge Interface Includes: ${GET_INCLUDES}")

add_library(${PROJECT_NAME} src/osqp_eigen_solver.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC console_bridge::console_bridge)

Output:

console_bridge Interface Includes: GET_INCLUDES-NOTFOUND
@Levi-Armstrong
Copy link
Author

To solve the issue temperately I had to add the following below to all cmake file performing a find_package.

get_target_property(CHECK_INCLUDE_DIRECTORIES console_bridge::console_bridge INTERFACE_INCLUDE_DIRECTORIES)
if (NOT ${CHECK_INCLUDE_DIRECTORIES})
  set_target_properties(console_bridge::console_bridge PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${console_bridge_INCLUDE_DIRS})
endif()

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

1 participant