import shutil from pathlib import Path from common.directory_helpers import pushd, get_local_prefix from package.package_info import PackageInfo def headers_install(src_directory: Path | str, package_info: PackageInfo, subdir: Path | str): """To keep the callers below looking same-y, this is like cmake_build_install() for header only libraries :param src_directory: I believe this is where the src copy resides :param package_info: package info :param subdir: Everything under that subdir will be copied """ with pushd(src_directory): install_prefix = package_info.install_location() # header only libs are structured any way they want, so I have to treat them # individually by having the subtree handed in here shutil.copytree(subdir, install_prefix / "include", dirs_exist_ok=True) return install_prefix