2017-04-20 22:46:44 +00:00
|
|
|
function(GetZstdLibraryVersion _header _major _minor _release)
|
2017-03-16 13:06:49 +00:00
|
|
|
# Read file content
|
|
|
|
FILE(READ ${_header} CONTENT)
|
|
|
|
|
2017-03-21 20:44:33 +00:00
|
|
|
string(REGEX MATCH ".*define ZSTD_VERSION_MAJOR *([0-9]+).*define ZSTD_VERSION_MINOR *([0-9]+).*define ZSTD_VERSION_RELEASE *([0-9]+)" VERSION_REGEX "${CONTENT}")
|
2017-03-16 13:06:49 +00:00
|
|
|
SET(${_major} ${CMAKE_MATCH_1} PARENT_SCOPE)
|
|
|
|
SET(${_minor} ${CMAKE_MATCH_2} PARENT_SCOPE)
|
|
|
|
SET(${_release} ${CMAKE_MATCH_3} PARENT_SCOPE)
|
|
|
|
endfunction()
|