Skip to content

Commit f678efc

Browse files
Corrected find_package(Python...)
1 parent 9de2de4 commit f678efc

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,13 @@ pybind11_add_module(openfhe
6666
### Python installation
6767
# Allow the user to specify the path to Python executable (if not provided, find it)
6868
option(PYTHON_EXECUTABLE_PATH "Path to Python executable" "")
69-
70-
if(NOT PYTHON_EXECUTABLE_PATH)
71-
# Find Python and its development components
72-
find_package(Python REQUIRED COMPONENTS Interpreter Development)
73-
else()
74-
# Set Python_EXECUTABLE to the specified path
69+
if(PYTHON_EXECUTABLE_PATH)
7570
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE_PATH}")
7671
endif()
77-
78-
# Find Python interpreter
79-
find_package(PythonInterp REQUIRED)
72+
find_package(Python REQUIRED COMPONENTS Interpreter Development)
8073

8174
# Check Python version
82-
if(${PYTHON_VERSION_MAJOR} EQUAL 3 AND ${PYTHON_VERSION_MINOR} GREATER_EQUAL 10)
75+
if(${Python_VERSION_MAJOR} EQUAL 3 AND ${Python_VERSION_MINOR} GREATER_EQUAL 10)
8376
execute_process(
8477
COMMAND "${Python_EXECUTABLE}" -c "from sys import exec_prefix; print(exec_prefix)"
8578
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES

0 commit comments

Comments
 (0)