mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
cmake: Fix passing PYTHON path via CMake variable if using IDF as library
Closes https://github.com/espressif/esp-idf/issues/6285
This commit is contained in:
parent
8ec8f61caa
commit
7a2c126054
@ -130,9 +130,11 @@ function(__build_init idf_path)
|
||||
# Must be global so as to be accessible from any subdirectory in custom projects.
|
||||
add_library(__idf_build_target STATIC IMPORTED GLOBAL)
|
||||
|
||||
set_default(python "python")
|
||||
# Set the Python path (which may be passed in via -DPYTHON=) and store in a build property
|
||||
set_default(PYTHON "python")
|
||||
file(TO_CMAKE_PATH ${PYTHON} PYTHON)
|
||||
idf_build_set_property(PYTHON ${PYTHON})
|
||||
|
||||
idf_build_set_property(PYTHON ${python})
|
||||
idf_build_set_property(IDF_PATH ${idf_path})
|
||||
|
||||
idf_build_set_property(__PREFIX idf)
|
||||
|
@ -6,12 +6,15 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# call.
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/idf.cmake)
|
||||
|
||||
# legacy variable for compatibility
|
||||
set(IDFTOOL ${PYTHON} "${IDF_PATH}/tools/idf.py")
|
||||
# Internally, the Python interpreter is already set to 'python'. Re-set here
|
||||
# to be absolutely sure.
|
||||
set_default(PYTHON "python")
|
||||
file(TO_CMAKE_PATH ${PYTHON} PYTHON)
|
||||
idf_build_set_property(PYTHON ${PYTHON})
|
||||
|
||||
# setting PYTHON variable here for compatibility only, new code should use
|
||||
# idf_build_get_property(variable PYTHON)
|
||||
idf_build_get_property(PYTHON PYTHON)
|
||||
if(NOT PYTHON)
|
||||
message(FATAL_ERROR "Internal error, PYTHON build property not set correctly.")
|
||||
endif()
|
||||
|
||||
# On processing, checking Python required modules can be turned off if it was
|
||||
# already checked externally.
|
||||
|
Loading…
Reference in New Issue
Block a user