μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
__main__.py
Go to the documentation of this file.
1# -*- coding: utf-8 -*-
2from __future__ import print_function
3
4import argparse
5import sys
6import sysconfig
7
8from .commands import get_cmake_dir, get_include
9
10
12 # type: () -> 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
28def main():
29 # type: () -> None
30
31 parser = argparse.ArgumentParser()
32 parser.add_argument(
33 "--includes",
34 action="store_true",
35 help="Include flags for both pybind11 and Python headers.",
36 )
37 parser.add_argument(
38 "--cmakedir",
39 action="store_true",
40 help="Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.",
41 )
42 args = parser.parse_args()
43 if not sys.argv[1:]:
44 parser.print_help()
45 if args.includes:
47 if args.cmakedir:
48 print(get_cmake_dir())
49
50
51if __name__ == "__main__":
52 main()
def print_includes()
Definition: __main__.py:11