From 897670b0abaa69b3094718b06486be06f0f121e5 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 15 Oct 2018 10:25:44 +1100 Subject: [PATCH] cmake: Handle ESPPORT environment variable correctly Closes https://github.com/espressif/esp-idf/issues/2553 --- components/esptool_py/run_esptool.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/esptool_py/run_esptool.cmake b/components/esptool_py/run_esptool.cmake index db4cf2031..a63eb55f0 100644 --- a/components/esptool_py/run_esptool.cmake +++ b/components/esptool_py/run_esptool.cmake @@ -17,10 +17,11 @@ endif() # Note: we can't expand these environment variables in the main IDF CMake build, # because we want to expand them at flashing time not at CMake runtime (so they can change # without needing a CMake re-run) -if(NOT ENV{ESPPORT}) +set(ESPPORT $ENV{ESPPORT}) +if(NOT ESPPORT) message("Note: esptool.py will search for a serial port. To specify a port, set the ESPPORT environment variable.") else() - set(port_arg "-p $ENV{ESPPORT}") + set(port_arg "-p ${ESPPORT}") endif() set(ESPBAUD $ENV{ESPBAUD})