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


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:59