Skip to content

Commit bc09bb0

Browse files
committed
switch from FindPythonInterp to FindPython
Deprecated since Cmake 3.12
1 parent 16660db commit bc09bb0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/content/tutorial-cmake.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ parts. Alternatively, you may want to make them `REQUIRED`.)
3434
find_package(lcm REQUIRED)
3535
include(${LCM_USE_FILE})
3636

37-
find_package(PythonInterp)
37+
find_package(Python COMPONENTS Interpreter)
3838
find_package(Java)
3939

4040
if(JAVA_FOUND)
@@ -201,7 +201,7 @@ generate these bindings always, or opportunistically when Python and/or Java
201201
are available, you may want to make this logic conditional, as in the approach
202202
shown here:
203203

204-
if(PYTHONINTERP_FOUND)
204+
if(${Python_Interpreter_FOUND})
205205
set(python_args PYTHON_SOURCES python_sources)
206206
endif()
207207
if(JAVA_FOUND)
@@ -243,7 +243,7 @@ As before, if you require Java, you can omit the `JAVA_FOUND` check.
243243

244244
First, let's revisit our variable names:
245245

246-
if(PYTHONINTERP_FOUND)
246+
if(${Python_Interpreter_FOUND})
247247
set(python_args PYTHON_SOURCES python_install_sources)
248248
endif()
249249
if(JAVA_FOUND)
@@ -278,7 +278,7 @@ Now, we'll install everything:
278278
${cpp_install_headers}
279279
)
280280

281-
if(PYTHONINTERP_FOUND)
281+
if(${Python_Interpreter_FOUND})
282282
lcm_install_python(${python_install_sources})
283283
endif()
284284

lcm-cmake/lcmUtilities.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ function(lcm_install_python)
478478

479479
# Set default destination and relative path, if none given
480480
if(NOT DEFINED _DESTINATION)
481-
if(NOT PYTHONINTERP_FOUND)
481+
if(NOT Python_Interpreter_FOUND)
482482
message(SEND_ERROR
483483
"lcm_install_python: no DESTINATION given"
484484
" and no Python interpreter found (required to guess DESTINATION)")

0 commit comments

Comments
 (0)