diff --git a/cmake/run_mkimage.cmake b/cmake/run_mkimage.cmake index a0ac4ec..821de76 100644 --- a/cmake/run_mkimage.cmake +++ b/cmake/run_mkimage.cmake @@ -1,6 +1,9 @@ file(READ ${VERSION_HEADER} V) -string(REGEX MATCH "\"([^\"]*)\"" _m "${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)