3DIR = os.path.abspath(os.path.dirname(__file__))
6def get_include(user: bool =
False) -> str:
8 Return the path to the pybind11 include directory. The historical "user"
9 argument
is unused,
and may be removed.
11 installed_path = os.path.join(DIR, "include")
12 source_path = os.path.join(os.path.dirname(DIR),
"include")
13 return installed_path
if os.path.exists(installed_path)
else source_path
18 Return the path to the pybind11 CMake module directory.
20 cmake_installed_path = os.path.join(DIR, "share",
"cmake",
"pybind11")
21 if os.path.exists(cmake_installed_path):
22 return cmake_installed_path
24 msg =
"pybind11 not installed, installation required to access the CMake files"
25 raise ImportError(msg)
30 Return the path to the pybind11 pkgconfig directory.
32 pkgconfig_installed_path = os.path.join(DIR, "share",
"pkgconfig")
33 if os.path.exists(pkgconfig_installed_path):
34 return pkgconfig_installed_path
36 msg =
"pybind11 not installed, installation required to access the pkgconfig files"
37 raise ImportError(msg)