I am writing a Cmake file and want to detect the version of numpy installed.
This is the part of my cmake file that deals with this
set(PYTHON_VERSION Python310)
set(Python3_ROOT_DIR "C:/pythpn")
message("root " ${Python3_ROOT_DIR})
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
find_package(PythonLibs 3 REQUIRED COMPONENTS Interpreter Development)
message("Python_FOUND " ${Python3_FOUND})
if (${Python3_FOUND})
message("python exe : "${Python3_EXECUTABLE})
message("numpy found " ${Python_NumPy_FOUND})
message("numpy found " ${Python3_NumPy_FOUND})
message("numpy : " ${Python3_NumPy_VERSION})
else()
message("no python")
endif()
The Python exe is found successfully but the numpy variables are not set, this is the result
Python_FOUND TRUE
python exe : C:/pythpn/python.exe
numpy found
numpy found FALSE
numpy :
numpy is definitely installed
cmake version is 3.28.1