Skip to content

Commit

Permalink
BUG: Use Python3_EXECUTABLE when specified
Browse files Browse the repository at this point in the history
The FindPython3.cmake module will silently fail and set the
Python3_EXECUTABLE variable to Python3_EXECUTABLE-NOTFOUND even if it is
explicitly specified with
-DPython3_EXECUTABLE:FILEPATH=/the/path/we/know/we/want.
  • Loading branch information
thewtex authored and hjmjohnson committed Feb 20, 2020
1 parent abefef1 commit 44e44ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,12 @@ if(BUILD_TESTING OR ITK_BUILD_DOCUMENTATION OR ITK_WRAP_PYTHON)
endif()
else()
if(ITK_WRAP_PYTHON)
if(DEFINED Python3_EXECUTABLE)
set(_specified_Python3_EXECUTABLE ${Python3_EXECUTABLE})
endif()
find_package(Python3 COMPONENTS Interpreter Development)
set(Python3_EXECUTABLE ${_specified_Python3_EXECUTABLE} CACHE INTERNAL
"Path to the Python interpreter" FORCE)
else()
find_package(Python3 COMPONENTS Interpreter)
endif()
Expand Down

0 comments on commit 44e44ac

Please sign in to comment.