Imported target "pybind11::headers" includes non-existent path #5091
Replies: 2 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.
-
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.cmake
the file is installed in/lib/cmake/pybind11/pybind11ConfigVersion.cmake
since/lib
is a symbolic link to/usr/lib
on Ubuntu 23.10.When I in a CMakeLists.txt run the command:
the file
/lib/cmake/pybind11/pybind11Config.cmake
will 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.cmake
is located in/usr/lib/cmake/pybind11/pybind11Config.cmake
and 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