FindPython3: Problem with result variables
I have a problem with FindPython3. It can be explained by the following code :
cmake_minimum_required(VERSION 3.16)
project(WhereIsPython NONE)
#SET(Python3_ROOT /home/anaconda3)
SET(Python3_ROOT_DIR /home/anaconda3/envs/smil)
find_package(Python3 COMPONENTS Interpreter Development NumPy)
MESSAGE(STATUS "CMAKE_VERSION : " ${CMAKE_VERSION})
MESSAGE(STATUS "FOUND : " ${Python3_FOUND})
MESSAGE(STATUS "ID : " ${Python3_INTERPRETER_ID})
MESSAGE(STATUS "EXECUTABLE : " ${Python3_EXECUTABLE})
MESSAGE(STATUS "INCLUDE : " ${_Python3_INCLUDE_DIR})
MESSAGE(STATUS "LIBRARIES : " ${Python3_LIBRARIES})
MESSAGE(STATUS "NUMPY : " ${_Python3_NumPy_INCLUDE_DIR})
The main problem I have is that some variables can be accessed only if they're prefixed by an underscore while in the documentation no mention is made to underscore prefixed variables. For example, in the above code, the two INCLUDE
variables.
The problem is the same if I set or not the Python3_ROOT_DIR
hint variable.
Maybe this is related to issue #22084 (closed)
Also, setting the CMAKE variable Python3_ROOT_DIR
work as a hint, but not Python3_ROOT
(as indicated in the find_package page).
Edited by Brad King