Map legacy variables
@@ -1403,6 +1403,13 @@ if(${TINYSPLINE_BINDING_REQUESTED})
# Python
if(${TINYSPLINE_ENABLE_PYTHON})
if(${TINYSPLINE_PYTHON_VERSION} STREQUAL "2")
+ # Map legacy variables.
+ if(DEFINED PYTHON_INCLUDE_DIR)
+ set(Python2_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
+ endif()
+ if(DEFINED PYTHON_LIBRARY)
+ set(Python2_LIBRARIES ${PYTHON_LIBRARY})
+ endif()
find_package(Python2 REQUIRED
COMPONENTS Interpreter Development
)
@@ -1411,6 +1418,13 @@ if(${TINYSPLINE_BINDING_REQUESTED})
set(TINYSPLINE_PYTHON_INCLUDE_DIRS ${Python2_INCLUDE_DIRS})
set(TINYSPLINE_PYTHON_LIBRARIES ${Python2_LIBRARIES})
elseif(${TINYSPLINE_PYTHON_VERSION} STREQUAL "3")
+ # Map legacy variables.
+ if(DEFINED PYTHON_INCLUDE_DIR)
+ set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
+ endif()
+ if(DEFINED PYTHON_LIBRARY)
+ set(Python3_LIBRARIES ${PYTHON_LIBRARY})
+ endif()
find_package(Python3 REQUIRED
COMPONENTS Interpreter Development
)
@@ -1420,6 +1434,13 @@ if(${TINYSPLINE_BINDING_REQUESTED})
set(TINYSPLINE_PYTHON_LIBRARIES ${Python3_LIBRARIES})
set(TINYSPLINE_PYTHON_DEFINES "-py3")
elseif(${TINYSPLINE_PYTHON_VERSION} STREQUAL "ANY")
+ # Map legacy variables.
+ if(DEFINED PYTHON_INCLUDE_DIR)
+ set(Python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
+ endif()
+ if(DEFINED PYTHON_LIBRARY)
+ set(Python_LIBRARIES ${PYTHON_LIBRARY})
+ endif()
find_package(Python REQUIRED
COMPONENTS Interpreter Development
)
