diff --git a/components/esptool_py/get_port_args.cmake b/components/esptool_py/get_port_args.cmake index 867094801c..e70f131046 100644 --- a/components/esptool_py/get_port_args.cmake +++ b/components/esptool_py/get_port_args.cmake @@ -3,14 +3,14 @@ # without needing a CMake re-run) set(ESPPORT $ENV{ESPPORT}) if(NOT ESPPORT) - message("Note: ${TOOL} will search for a serial port. To specify a port, set the ESPPORT environment variable.") + message("Note: ${SERIAL_TOOL} will search for a serial port. To specify a port, set the ESPPORT environment variable.") else() set(port_arg "-p ${ESPPORT}") endif() set(ESPBAUD $ENV{ESPBAUD}) if(NOT ESPBAUD) - message("Note: ${TOOL} will attempt to set baud rate automatically. " + message("Note: ${SERIAL_TOOL} will attempt to set baud rate automatically. " "To specify a baud rate, set the ESPBAUD environment variable.") else() set(baud_arg "-b ${ESPBAUD}") diff --git a/components/esptool_py/project_include.cmake b/components/esptool_py/project_include.cmake index cd746a6cda..038a07c937 100644 --- a/components/esptool_py/project_include.cmake +++ b/components/esptool_py/project_include.cmake @@ -133,9 +133,9 @@ endif() add_custom_target(erase_flash COMMAND ${CMAKE_COMMAND} -D IDF_PATH="${idf_path}" - -D ESPTOOLPY="${ESPTOOLPY}" - -D ESPTOOL_ARGS="erase_flash" - -P run_esptool.cmake + -D SERIAL_TOOL="${ESPTOOLPY}" + -D SERIAL_TOOL_ARGS="erase_flash" + -P run_serial_tool.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} USES_TERMINAL ) @@ -332,10 +332,10 @@ function(esptool_py_flash_target target_name main_args sub_args) add_custom_target(${target_name} COMMAND ${CMAKE_COMMAND} -D IDF_PATH="${idf_path}" - -D ESPTOOLPY="${ESPTOOLPY}" - -D ESPTOOL_ARGS="${main_args};write_flash;@${target_name}_args" + -D SERIAL_TOOL="${ESPTOOLPY}" + -D SERIAL_TOOL_ARGS="${main_args};write_flash;@${target_name}_args" -D WORKING_DIRECTORY="${build_dir}" - -P ${esptool_py_dir}/run_esptool.cmake + -P ${esptool_py_dir}/run_serial_tool.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} USES_TERMINAL ) @@ -373,10 +373,10 @@ $,\n>") add_custom_target(encrypted-${target_name} COMMAND ${CMAKE_COMMAND} -D IDF_PATH="${idf_path}" - -D ESPTOOLPY="${ESPTOOLPY}" - -D ESPTOOL_ARGS="${main_args};write_flash;@encrypted_${target_name}_args" + -D SERIAL_TOOL="${ESPTOOLPY}" + -D SERIAL_TOOL_ARGS="${main_args};write_flash;@encrypted_${target_name}_args" -D WORKING_DIRECTORY="${build_dir}" - -P ${esptool_py_dir}/run_esptool.cmake + -P ${esptool_py_dir}/run_serial_tool.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} USES_TERMINAL ) diff --git a/components/esptool_py/run_cmd.cmake b/components/esptool_py/run_cmd.cmake index 8eefabbc21..a5620a3420 100644 --- a/components/esptool_py/run_cmd.cmake +++ b/components/esptool_py/run_cmd.cmake @@ -11,5 +11,5 @@ execute_process(COMMAND ${CMD} if(${result}) # No way to have CMake silently fail, unfortunately - message(FATAL_ERROR "${TOOL} failed") + message(FATAL_ERROR "${SERIAL_TOOL} failed") endif() diff --git a/components/esptool_py/run_esptool.cmake b/components/esptool_py/run_serial_tool.cmake similarity index 70% rename from components/esptool_py/run_esptool.cmake rename to components/esptool_py/run_serial_tool.cmake index e632457c36..04d3f5afdf 100644 --- a/components/esptool_py/run_esptool.cmake +++ b/components/esptool_py/run_serial_tool.cmake @@ -8,14 +8,12 @@ # cmake_minimum_required(VERSION 3.5) -set(TOOL "esptool.py") - -if(NOT ESPTOOLPY OR NOT ESPTOOL_ARGS) - message(FATAL_ERROR "ESPTOOLPY and ESPTOOL_ARGS must " +if(NOT SERIAL_TOOL OR NOT SERIAL_TOOL_ARGS) + message(FATAL_ERROR "SERIAL_TOOL and SERIAL_TOOL_ARGS must " "be specified on the CMake command line. For direct execution, it is " - "strongly recommended to run ${TOOL} directly.") + "strongly recommended to run ${SERIAL_TOOL} directly.") endif() include("${CMAKE_CURRENT_LIST_DIR}/get_port_args.cmake") -set(CMD "${ESPTOOLPY} ${port_arg} ${baud_arg} ${ESPTOOL_ARGS}") +set(CMD "${SERIAL_TOOL} ${port_arg} ${baud_arg} ${SERIAL_TOOL_ARGS}") include("${CMAKE_CURRENT_LIST_DIR}/run_cmd.cmake")