μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
commands.py
Go to the documentation of this file.
1import os
2
3DIR = os.path.abspath(os.path.dirname(__file__))
4
5
6def get_include(user: bool = False) -> str: # pylint: disable=unused-argument
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
16def 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
28def 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)
def get_cmake_dir()
Definition: commands.py:14
str get_pkgconfig_dir()
Definition: commands.py:28