CMake: Fix find Matplotlib

This commit is contained in:
marioalexis
2021-03-10 01:23:15 -03:00
committed by wwmayer
parent 839b96385c
commit 0b5500948a
3 changed files with 5 additions and 3 deletions

View File

@@ -9,7 +9,7 @@
# MATPLOTLIB_VERSION_PATCH - the patch version number of matplotlib
# MATPLOTLIB_PATH_DIRS - path to the matplotlib include files
IF(PYTHONINTERP_FOUND)
IF(Python3_Interpreter_FOUND)
# Try to import matplotlib into Python interpreter. Python
# interpreter was found previously as required package, so
# don't take care about this.

View File

@@ -3,10 +3,10 @@ macro(SetupMatplotlib)
find_package(Matplotlib)
if (MATPLOTLIB_FOUND)
message(STATUS "-- matplotlib-${MATPLOTLIB_VERSION} has been found.")
message(STATUS "Found Matplotlib: ${MATPLOTLIB_PATH_DIRS} (found version \"${MATPLOTLIB_VERSION}\")")
else(MATPLOTLIB_FOUND)
message("=====================================================\n"
"matplotlib not found, Plot module won't be available.\n"
"Matplotlib not found, Plot module won't be available.\n"
"=====================================================\n")
endif(MATPLOTLIB_FOUND)

View File

@@ -138,6 +138,7 @@ macro(SetupPython)
set(Python3_VERSION_MAJOR ${PYTHON_VERSION_MAJOR})
set(Python3_VERSION_MINOR ${PYTHON_VERSION_MINOR})
set(Python3_VERSION_PATCH ${PYTHON_VERSION_PATCH})
set(Python3_Interpreter_FOUND ${PYTHONINTERP_FOUND})
else()
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
@@ -150,6 +151,7 @@ macro(SetupPython)
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR})
set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH})
set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND})
endif()
# prevent python3 lower than 3.6