1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

CMake: namespace modules and set CMAKE_MODULE_PATH

This commit is contained in:
Michael Maltese
2017-04-20 15:46:44 -07:00
parent 1a96bec8db
commit 7f1fb95566
5 changed files with 10 additions and 9 deletions

View File

@ -0,0 +1,9 @@
function(GetZstdLibraryVersion _header _major _minor _release)
# Read file content
FILE(READ ${_header} CONTENT)
string(REGEX MATCH ".*define ZSTD_VERSION_MAJOR *([0-9]+).*define ZSTD_VERSION_MINOR *([0-9]+).*define ZSTD_VERSION_RELEASE *([0-9]+)" VERSION_REGEX "${CONTENT}")
SET(${_major} ${CMAKE_MATCH_1} PARENT_SCOPE)
SET(${_minor} ${CMAKE_MATCH_2} PARENT_SCOPE)
SET(${_release} ${CMAKE_MATCH_3} PARENT_SCOPE)
endfunction()