__main__.py
Go to the documentation of this file.
1 # pylint: disable=missing-function-docstring
2 
3 import argparse
4 import sys
5 import sysconfig
6 
7 from ._version import __version__
8 from .commands import get_cmake_dir, get_include, get_pkgconfig_dir
9 
10 
11 def print_includes() -> None:
12  dirs = [
13  sysconfig.get_path("include"),
14  sysconfig.get_path("platinclude"),
15  get_include(),
16  ]
17 
18  # Make unique but preserve order
19  unique_dirs = []
20  for d in dirs:
21  if d and d not in unique_dirs:
22  unique_dirs.append(d)
23 
24  print(" ".join("-I" + d for d in unique_dirs))
25 
26 
27 def main() -> None:
28  parser = argparse.ArgumentParser()
29  parser.add_argument(
30  "--version",
31  action="version",
32  version=__version__,
33  help="Print the version and exit.",
34  )
35  parser.add_argument(
36  "--includes",
37  action="store_true",
38  help="Include flags for both pybind11 and Python headers.",
39  )
40  parser.add_argument(
41  "--cmakedir",
42  action="store_true",
43  help="Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.",
44  )
45  parser.add_argument(
46  "--pkgconfigdir",
47  action="store_true",
48  help="Print the pkgconfig directory, ideal for setting $PKG_CONFIG_PATH.",
49  )
50  args = parser.parse_args()
51  if not sys.argv[1:]:
52  parser.print_help()
53  if args.includes:
55  if args.cmakedir:
57  if args.pkgconfigdir:
59 
60 
61 if __name__ == "__main__":
62  main()
Eigen::internal::print
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
Definition: NEON/PacketMath.h:3115
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.__main__.print_includes
None print_includes()
Definition: __main__.py:11
pybind11.commands.get_pkgconfig_dir
str get_pkgconfig_dir()
Definition: commands.py:28
pybind11.__main__.main
None main()
Definition: __main__.py:27


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