1 from __future__
import annotations
5 DIR = os.path.abspath(os.path.dirname(__file__))
10 Return the path to the pybind11 include directory. The historical "user"
11 argument is unused, and may be removed.
13 installed_path = os.path.join(DIR,
"include")
14 source_path = os.path.join(os.path.dirname(DIR),
"include")
15 return installed_path
if os.path.exists(installed_path)
else source_path
20 Return the path to the pybind11 CMake module directory.
22 cmake_installed_path = os.path.join(DIR,
"share",
"cmake",
"pybind11")
23 if os.path.exists(cmake_installed_path):
24 return cmake_installed_path
26 msg =
"pybind11 not installed, installation required to access the CMake files"
27 raise ImportError(msg)
32 Return the path to the pybind11 pkgconfig directory.
34 pkgconfig_installed_path = os.path.join(DIR,
"share",
"pkgconfig")
35 if os.path.exists(pkgconfig_installed_path):
36 return pkgconfig_installed_path
38 msg =
"pybind11 not installed, installation required to access the pkgconfig files"
39 raise ImportError(msg)