Skip to content

Commit

Permalink
cmake: patch to use system pybind11
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <rui@chenrui.dev>
  • Loading branch information
chenrui333 committed May 20, 2024
1 parent ae0dee0 commit 52b3261
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
find_package(Python3 COMPONENTS Interpreter Development.Module REQUIRED)

set(PYBIND11_VER 2.12.0)

include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.10.0)
FetchContent_MakeAvailable(pybind11)
find_package(pybind11 ${PYBIND11_VER} QUIET)

if(NOT pybind11_FOUND)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v${PYBIND11_VER})
FetchContent_MakeAvailable(pybind11)
endif()

add_library(ale-py MODULE ale_python_interface.cpp)
# Depend on the ALE and pybind11 module
Expand Down

0 comments on commit 52b3261

Please sign in to comment.