Skip to content

Commit 5177f73

Browse files
committed
feat: add entrypoint for cmake modules dir
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 17c6809 commit 5177f73

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def remove_output(*sources: str) -> Iterator[None]:
144144
stdout=sys.stdout,
145145
stderr=sys.stderr,
146146
)
147+
Path("pybind11/share/cmake/pybind11/__init__.py").touch()
147148

148149
txt = get_and_replace(setup_py, version=version, extra_cmd=extra_cmd)
149150
code = compile(txt, setup_py, "exec")

tests/extra_python_package/test_files.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
}
6666

6767
cmake_files = {
68+
"share/cmake/pybind11/__init__.py",
6869
"share/cmake/pybind11/FindPythonLibsNew.cmake",
6970
"share/cmake/pybind11/pybind11Common.cmake",
7071
"share/cmake/pybind11/pybind11Config.cmake",

tools/setup_main.py.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ setup(
2626
"pybind11.include.pybind11.detail": ["*.h"],
2727
"pybind11.include.pybind11.eigen": ["*.h"],
2828
"pybind11.include.pybind11.stl": ["*.h"],
29-
"pybind11.share.cmake.pybind11": ["*.cmake"],
29+
"pybind11.share.cmake.pybind11": ["*.cmake", "*.py"],
3030
"pybind11.share.pkgconfig": ["*.pc"],
3131
},
3232
extras_require={
@@ -38,6 +38,9 @@ setup(
3838
],
3939
"pipx.run": [
4040
"pybind11 = pybind11.__main__:main",
41+
],
42+
"cmake.modules": [
43+
"pybind11 = pybind11.share.cmake.pybind11",
4144
]
4245
},
4346
cmdclass=cmdclass

0 commit comments

Comments
 (0)