Imported target "pybind11::headers" includes non-existent path #5091
Replies: 3 comments
-
|
I've run into this as well on Ubuntu 24.04, but strangely my colleagues didn't have this issue in a container and our CI doesn't run into this issue either (also using docker), so I'm not entirely sure why, but there seems to be another factor involved to trigger this issue, even though your explanation makes sense. I have the same kind of symlink on my machine, but so does my colleague and our CI: And here are my |
Beta Was this translation helpful? Give feedback.
-
|
It seems to be related to the ordering of the by moving the solved the problem for me. |
Beta Was this translation helpful? Give feedback.
-
|
I know this is more than 1 year old, but I recently ran into this issue on Ubuntu 24.04 (ROS Jazzy container) and couldn't fix it using @hakonhagland's suggestion. I did manage to get it to compile by linking With the help of a coworker, we managed to get a working solution w/o any external modifications by adding the following line after set_target_properties(pybind11::pybind11_headers PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "/usr/include"
)This essentially overwrites the offending |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am using pybind11 2.11.1 on Ubuntu 23.10. I have installed the package
pybind11-dev:Note that, even if the list above says
/usr/lib/cmake/pybind11/pybind11ConfigVersion.cmakethe file is installed in/lib/cmake/pybind11/pybind11ConfigVersion.cmakesince/libis a symbolic link to/usr/libon Ubuntu 23.10.When I in a CMakeLists.txt run the command:
the file
/lib/cmake/pybind11/pybind11Config.cmakewill be executed and line 206 in that file:I believe this is the same as this line in the GitHub repository:
pybind11/tools/pybind11Config.cmake.in
Line 201 in f33f6af
The problem is that the above
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)assumes thatpybind11Config.cmakeis located in/usr/lib/cmake/pybind11/pybind11Config.cmakeand not in/lib/cmake/pybind11/pybind11Config.cmake. So PACKAGE_PREFIX_DIR will be set to "/" instead of "/usr" which will produce errors of the following type:Beta Was this translation helpful? Give feedback.
All reactions