file(READ ${VERSION_HEADER} V) string(REGEX MATCH "NINLIGHT_FW_VERSION[ \t]+\"([^\"]*)\"" _m "${V}") set(VERSION "${CMAKE_MATCH_1}") if(NOT VERSION) message(FATAL_ERROR "run_mkimage: NINLIGHT_FW_VERSION not found in ${VERSION_HEADER}") endif() execute_process(COMMAND python3 ${MKIMAGE} --image ${IMAGE} --device ${DEVICE} --version ${VERSION} --out ${OUT} RESULT_VARIABLE rc) if(NOT rc EQUAL 0) message(FATAL_ERROR "nl_mkimage failed (${rc})") endif()