Skip to content

Fix CMakeLists and APB_PYBIND11_DIR usage

Joe Snyder requested to merge joe-snyder/autopybind11:fix_cmakelists into master

Add a PYBIND11_DIR entry to the top-level CMakeLists.txt file where the autopybind framework fetches pybind11. If that variable is set in some other context (External CMakeLists.txt via find_package or FetchContent or on the command line) use the value given.

If not defined, the fetching of pybind11 will continue as expected.

Check the APB_PYBIND11_DIR for a CMakeLists file before using add subdirectory. If it doesn't exist, use the path as an include directory instead.

Allows #148 (closed) to be used properly.

Merge request reports