diff --git a/CMakeLists.txt b/CMakeLists.txt index 06e7b52..d3725b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ project(quicktex) # Find dependencies find_package(Python COMPONENTS Interpreter Development) +find_package(pybind11 CONFIG REQUIRED) find_package(OpenMP) -add_subdirectory(extern/pybind11) # Collect source files file(GLOB SOURCE_FILES diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index e273cee..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -graft extern \ No newline at end of file diff --git a/extern/pybind11 b/extern/pybind11 deleted file mode 160000 index 8de7772..0000000 --- a/extern/pybind11 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8de7772cc72daca8e947b79b83fea46214931604 diff --git a/pyproject.toml b/pyproject.toml index 8a7ea04..b1e71a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,8 +3,9 @@ requires = [ "setuptools>=61", "setuptools_scm>=6.2", "wheel", + "cmake>=3.17", + "pybind11~=2.6.1", "ninja; sys_platform != 'win32'", - "cmake>=3.12", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 89042b0..73a1074 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ import os import re import sys import subprocess +import pybind11 from setuptools import setup, Extension from setuptools.command.build_ext import build_ext @@ -38,9 +39,12 @@ class CMakeBuild(build_ext): # Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON cmake_args = [ "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}".format(extdir), + "-Dpybind11_DIR={}".format(pybind11.get_cmake_dir()), "-DPython_EXECUTABLE={}".format(sys.executable), "-DQUICKTEX_VERSION_INFO={}".format(version), "-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm + # clear cached make program binary, see https://github.com/pypa/setuptools/issues/2912 + "-U", "CMAKE_MAKE_PROGRAM", ] build_args = []