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


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:31:51