function(read_sdk_version out_var version_file)
    file(READ ${version_file} FILE_CONTENTS)
    string(REGEX MATCH "define MEGA_MAJOR_VERSION ([0-9]*)" _ ${FILE_CONTENTS})
    set(VER_STRING ${CMAKE_MATCH_1})
    string(REGEX MATCH "define MEGA_MINOR_VERSION ([0-9]*)" _ ${FILE_CONTENTS})
    set(VER_STRING ${VER_STRING}.${CMAKE_MATCH_1})
    string(REGEX MATCH "define MEGA_MICRO_VERSION ([0-9]*)" _ ${FILE_CONTENTS})
    set(${out_var} ${VER_STRING}.${CMAKE_MATCH_1} PARENT_SCOPE)
endfunction()
