Skip to content

Commit

Permalink
python: Use PYTHON_VERSION_MAJOR when using PythonInterp
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Nov 2, 2023
1 parent ebd51ab commit 7ed114a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ macro(FINDPYTHON)
# Retrieve the corresponding value of PYTHON_INCLUDE_DIR if it is not
# defined
if(NOT DEFINED PYTHON_INCLUDE_DIR)
if(_PYTHON_VERSION_MAJOR EQUAL "2")
if(PYTHON_VERSION_MAJOR EQUAL "2")
set(_PYTHON_INCLUDE_DIR_CMD
"import distutils.sysconfig as sysconfig; print(sysconfig.get_python_inc())"
)
Expand Down Expand Up @@ -282,7 +282,7 @@ macro(FINDPYTHON)
"import sys, os; print(os.sep.join(['lib', 'python' + '.'.join(sys.version.split('.')[:2]), 'site-packages']))"
)
else()
if(_PYTHON_VERSION_MAJOR EQUAL "2")
if(PYTHON_VERSION_MAJOR EQUAL "2")
set(_PYTHON_SITELIB_CMD
"from distutils import sysconfig; print(sysconfig.get_python_lib(prefix='', plat_specific=False))"
)
Expand Down

0 comments on commit 7ed114a

Please sign in to comment.