1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
From: Dima Kogan <dima@secretsauce.net>
Date: Sat, 11 Feb 2023 16:25:10 -0800
Subject: Using the system pybind11
---
python/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 79a27f1..02ba17a 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -21,7 +21,14 @@ include(PybindWrap)
## Load the necessary files to compile the wrapper
# Load the pybind11 code
-add_subdirectory(${PROJECT_SOURCE_DIR}/wrap/pybind11 pybind11)
+
+# This is required to avoid an error in modern pybind11 cmake scripts:
+if(POLICY CMP0057)
+ cmake_policy(SET CMP0057 NEW)
+endif()
+
+find_package(pybind11 CONFIG REQUIRED)
+
# Set the wrapping script variable
set(PYBIND_WRAP_SCRIPT "${PROJECT_SOURCE_DIR}/wrap/scripts/pybind_wrap.py")
############################################################
|