mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-10-31 09:20:38 +00:00
b7f0d87daf
Done with Vort's (https://github.com/Vort) cooperation Signed-off-by: R4SAS <r4sas@i2pmail.org>
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()
|