]> granicus.if.org Git - esp-idf/commitdiff
cmake: Handle ESPPORT environment variable correctly
authorAngus Gratton <gus@projectgus.com>
Sun, 14 Oct 2018 23:25:44 +0000 (10:25 +1100)
committerAngus Gratton <gus@projectgus.com>
Sun, 14 Oct 2018 23:25:44 +0000 (10:25 +1100)
Closes https://github.com/espressif/esp-idf/issues/2553

components/esptool_py/run_esptool.cmake

index db4cf20310a03e5fc11af7dff9c51af15dbb4877..a63eb55f0b90466cdfe17fa17cf967a25365bab7 100644 (file)
@@ -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})