commands.py
Go to the documentation of this file.
1 import os
2 
3 DIR = os.path.abspath(os.path.dirname(__file__))
4 
5 
6 def get_include(user: bool = False) -> str: # noqa: ARG001
7  """
8  Return the path to the pybind11 include directory. The historical "user"
9  argument is unused, and may be removed.
10  """
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
14 
15 
16 def get_cmake_dir() -> str:
17  """
18  Return the path to the pybind11 CMake module directory.
19  """
20  cmake_installed_path = os.path.join(DIR, "share", "cmake", "pybind11")
21  if os.path.exists(cmake_installed_path):
22  return cmake_installed_path
23 
24  msg = "pybind11 not installed, installation required to access the CMake files"
25  raise ImportError(msg)
26 
27 
28 def get_pkgconfig_dir() -> str:
29  """
30  Return the path to the pybind11 pkgconfig directory.
31  """
32  pkgconfig_installed_path = os.path.join(DIR, "share", "pkgconfig")
33  if os.path.exists(pkgconfig_installed_path):
34  return pkgconfig_installed_path
35 
36  msg = "pybind11 not installed, installation required to access the pkgconfig files"
37  raise ImportError(msg)
pybind11.commands.get_include
str get_include(bool user=False)
Definition: commands.py:6
pybind11.commands.get_cmake_dir
str get_cmake_dir()
Definition: commands.py:16
pybind11.commands.get_pkgconfig_dir
str get_pkgconfig_dir()
Definition: commands.py:28


gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:00:36