Warning, /jana2/src/python/externals/pybind11-2.10.3/tools/setup_global.py.in is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env python3
0002
0003 # Setup script for pybind11-global (in the sdist or in tools/setup_global.py in the repository)
0004 # This package is targeted for easy use from CMake.
0005
0006 import glob
0007 import os
0008 import re
0009
0010 # Setuptools has to be before distutils
0011 from setuptools import setup
0012
0013 from distutils.command.install_headers import install_headers
0014
0015 class InstallHeadersNested(install_headers):
0016 def run(self):
0017 headers = self.distribution.headers or []
0018 for header in headers:
0019 # Remove pybind11/include/
0020 short_header = header.split("/", 2)[-1]
0021
0022 dst = os.path.join(self.install_dir, os.path.dirname(short_header))
0023 self.mkpath(dst)
0024 (out, _) = self.copy_file(header, dst)
0025 self.outfiles.append(out)
0026
0027
0028 main_headers = glob.glob("pybind11/include/pybind11/*.h")
0029 detail_headers = glob.glob("pybind11/include/pybind11/detail/*.h")
0030 eigen_headers = glob.glob("pybind11/include/pybind11/eigen/*.h")
0031 stl_headers = glob.glob("pybind11/include/pybind11/stl/*.h")
0032 cmake_files = glob.glob("pybind11/share/cmake/pybind11/*.cmake")
0033 pkgconfig_files = glob.glob("pybind11/share/pkgconfig/*.pc")
0034 headers = main_headers + detail_headers + stl_headers + eigen_headers
0035
0036 cmdclass = {"install_headers": InstallHeadersNested}
0037 $extra_cmd
0038
0039 # This will _not_ affect installing from wheels,
0040 # only building wheels or installing from SDist.
0041 # Primarily intended on Windows, where this is sometimes
0042 # customized (for example, conda-forge uses Library/)
0043 base = os.environ.get("PYBIND11_GLOBAL_PREFIX", "")
0044
0045 # Must have a separator
0046 if base and not base.endswith("/"):
0047 base += "/"
0048
0049 setup(
0050 name="pybind11_global",
0051 version="$version",
0052 packages=[],
0053 headers=headers,
0054 data_files=[
0055 (base + "share/cmake/pybind11", cmake_files),
0056 (base + "share/pkgconfig", pkgconfig_files),
0057 (base + "include/pybind11", main_headers),
0058 (base + "include/pybind11/detail", detail_headers),
0059 (base + "include/pybind11/eigen", eigen_headers),
0060 (base + "include/pybind11/stl", stl_headers),
0061 ],
0062 cmdclass=cmdclass,
0063 )