Adding versions to cmake
This commit is contained in:
parent
693b45c561
commit
6541682433
|
@ -9,6 +9,9 @@ endif()
|
|||
|
||||
project(simdjson)
|
||||
set(SIMDJSON_LIB_NAME simdjson)
|
||||
set(PROJECT_VERSION_MAJOR 0)
|
||||
set(PROJECT_VERSION_MINOR 0)
|
||||
set(PROJECT_VERSION_PATCH 1)
|
||||
set(SIMDJSON_LIB_VERSION "0.0.1" CACHE STRING "simdjson library version")
|
||||
set(SIMDJSON_LIB_SOVERSION "0" CACHE STRING "simdjson library soversion")
|
||||
|
||||
|
|
|
@ -100,13 +100,22 @@ import fileinput
|
|||
import re
|
||||
|
||||
newmajorversionstring = str(newversion[0])
|
||||
mewminorversionstring = str(newversion[1])
|
||||
newrevversionstring = str(newversion[2])
|
||||
newversionstring = str(newversion[0]) + "." + str(newversion[1]) + "." + str(newversion[2])
|
||||
cmakefile = maindir + os.sep + "CMakeLists.txt"
|
||||
for line in fileinput.input(cmakefile, inplace=1, backup='.bak'):
|
||||
line = re.sub('SIMDJSON_LIB_VERSION "\d+\.\d+\.\d+','SIMDJSON_LIB_VERSION "'+newversionstring, line.rstrip())
|
||||
line = re.sub('SIMDJSON_LIB_SOVERSION "\d+','SIMDJSON_LIB_SOVERSION "'+newmajorversionstring, line)
|
||||
line = re.sub('set(PROJECT_VERSION_MAJOR \d+','set(PROJECT_VERSION_MAJOR '+newmajorversionstring, line)
|
||||
line = re.sub('set(PROJECT_VERSION_MINOR \d+','set(PROJECT_VERSION_MINOR '+mewminorversionstring, line)
|
||||
line = re.sub('set(PROJECT_VERSION_PATCH \d+','set(PROJECT_VERSION_PATCH '+newrevversionstring, line)
|
||||
print(line)
|
||||
|
||||
set(PROJECT_VERSION_MAJOR 0)
|
||||
set(PROJECT_VERSION_MINOR 0)
|
||||
set(PROJECT_VERSION_PATCH 1)
|
||||
|
||||
print("modified "+cmakefile+", a backup was made")
|
||||
|
||||
scriptlocation = os.path.dirname(os.path.abspath(__file__))
|
||||
|
|
Loading…
Reference in New Issue