run_esptool.cmake 817 B

123456789101112131415161718192021
  1. # A CMake script to run esptool commands from within ninja or make
  2. # or another cmake-based build runner
  3. #
  4. # (Needed to expand environment variables, for backwards compatibility.)
  5. #
  6. # It is recommended to NOT USE this CMake script if you have the option of
  7. # running esptool.py directly. This script exists only for use inside CMake builds.
  8. #
  9. cmake_minimum_required(VERSION 3.5)
  10. set(TOOL "esptool.py")
  11. if(NOT ESPTOOLPY OR NOT ESPTOOL_ARGS)
  12. message(FATAL_ERROR "ESPTOOLPY and ESPTOOL_ARGS must "
  13. "be specified on the CMake command line. For direct execution, it is "
  14. "strongly recommended to run ${TOOL} directly.")
  15. endif()
  16. include("${CMAKE_CURRENT_LIST_DIR}/get_port_args.cmake")
  17. set(CMD "${ESPTOOLPY} ${port_arg} ${baud_arg} ${ESPTOOL_ARGS}")
  18. include("${CMAKE_CURRENT_LIST_DIR}/run_cmd.cmake")