"on the PATH, or an MSYS2 version of gcc on the PATH to build mconf-idf. "
"Consult the setup docs for ESP-IDF on Windows.")
endif()
- elseif(WINPTY)
- set(MCONF "\"${WINPTY}\" \"${MCONF}\"")
+ else()
+ execute_process(COMMAND "${MCONF}" -v
+ RESULT_VARIABLE mconf_res
+ OUTPUT_VARIABLE mconf_out
+ ERROR_VARIABLE mconf_err)
+ if(${mconf_res})
+ message(WARNING "Failed to detect version of mconf-idf. Return code was ${mconf_res}.")
+ else()
+ string(STRIP "${mconf_out}" mconf_out)
+ set(mconf_expected_ver "mconf-v4.6.0.0-idf-20190628-win32")
+ if(NOT ${mconf_out} STREQUAL "mconf-idf version ${mconf_expected_ver}")
+ message(WARNING "Unexpected ${mconf_out}. Expected ${mconf_expected_ver}. "
+ "Please check the ESP-IDF Getting Started guide for version "
+ "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH} "
+ "to correct this issue")
+ else()
+ message(STATUS "${mconf_out}") # prints: mconf-idf version ....
+ endif()
+ endif()
+ if(WINPTY)
+ set(MCONF "\"${WINPTY}\" \"${MCONF}\"")
+ endif()
endif()
endif()
+ if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD")
+ set(MAKE_COMMMAND "gmake")
+ else()
+ set(MAKE_COMMMAND "make")
+ endif()
if(NOT MCONF)
# Use the existing Makefile to build mconf (out of tree) when needed
externalproject_add(mconf-idf
SOURCE_DIR ${src_path}
CONFIGURE_COMMAND ""
- BINARY_DIR "kconfig_bin"
+ BINARY_DIR "${CMAKE_BINARY_DIR}/kconfig_bin"
BUILD_COMMAND rm -f ${src_path}/zconf.lex.c ${src_path}/zconf.hash.c
- COMMAND make -f ${src_path}/Makefile mconf-idf
+ COMMAND ${MAKE_COMMMAND} -f ${src_path}/Makefile mconf-idf
BUILD_BYPRODUCTS ${MCONF}
INSTALL_COMMAND ""
EXCLUDE_FROM_ALL 1