mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-10 01:10:32 +00:00
17 lines
551 B
CMake
17 lines
551 B
CMake
|
# read version
|
||
|
|
||
|
function(set_version version_file output_var)
|
||
|
file(READ "${version_file}" version_data)
|
||
|
|
||
|
string(REGEX MATCH "I2PD_VERSION_MAJOR ([0-9]*)" _ ${version_data})
|
||
|
set(version_major ${CMAKE_MATCH_1})
|
||
|
|
||
|
string(REGEX MATCH "I2PD_VERSION_MINOR ([0-9]*)" _ ${version_data})
|
||
|
set(version_minor ${CMAKE_MATCH_1})
|
||
|
|
||
|
string(REGEX MATCH "I2PD_VERSION_MICRO ([0-9]*)" _ ${version_data})
|
||
|
set(version_micro ${CMAKE_MATCH_1})
|
||
|
|
||
|
set(${output_var} "${version_major}.${version_minor}.${version_micro}" PARENT_SCOPE)
|
||
|
endfunction()
|