Skip to content

Commit

Permalink
Merge pull request #1484 from ZzEeKkAa/fix/cmake_search
Browse files Browse the repository at this point in the history
Fix cmake FindDpctl.cmake
  • Loading branch information
oleksandr-pavlyk authored Dec 6, 2023
2 parents 07dea79 + 6950a63 commit 7e82c21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmake/FindDpctl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ if(NOT Dpctl_FOUND)
find_package(Python 3.9 REQUIRED
COMPONENTS Interpreter Development.Module)

if(PYTHON_EXECUTABLE)
execute_process(COMMAND "${PYTHON_EXECUTABLE}"
if(Python_EXECUTABLE)
execute_process(COMMAND "${Python_EXECUTABLE}"
-c "import dpctl; print(dpctl.get_include())"
OUTPUT_VARIABLE _dpctl_include_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
execute_process(COMMAND "${PYTHON_EXECUTABLE}"
execute_process(COMMAND "${Python_EXECUTABLE}"
-c "import dpctl; print(dpctl.__version__)"
OUTPUT_VARIABLE Dpctl_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand All @@ -38,7 +38,7 @@ endif()

find_path(Dpctl_INCLUDE_DIR
dpctl_capi.h dpctl4pybind11.hpp dpctl_sycl_interface.h
PATHS "${_dpctl_include_dir}" "${PYTHON_INCLUDE_DIR}"
PATHS "${_dpctl_include_dir}" "${Python_INCLUDE_DIRS}"
PATH_SUFFIXES dpctl/include
)
get_filename_component(_dpctl_dir ${_dpctl_include_dir} DIRECTORY)
Expand Down

0 comments on commit 7e82c21

Please sign in to comment.