Take the version number from `public_release_name`

This commit is contained in:
Laurent Rineau 2019-10-31 18:34:08 +01:00
parent 4f97bd5102
commit 21fedbf0ad
2 changed files with 14 additions and 4 deletions

View File

@ -253,10 +253,15 @@ if (NOT CGAL_CREATED_VERSION_NUM)
set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}")
endif()
else()
#read version.h and get the line with CGAL_VERSION
file(STRINGS "${CGAL_ROOT}/include/CGAL/version.h" CGAL_VERSION_LINE REGEX "CGAL_VERSION ")
#extract release id
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.?[0-9]*" CGAL_CREATED_VERSION_NUM "${CGAL_VERSION_LINE}")
if(EXISTS "${CGAL_ROOT}/doc/public_release_name")
file(STRINGS "${CGAL_ROOT}/doc/public_release_name" CGAL_VERSION_LINE)
string(REGEX REPLACE "CGAL-" "" CGAL_CREATED_VERSION_NUM "${CGAL_VERSION_LINE}")
else()
#read version.h and get the line with CGAL_VERSION
file(STRINGS "${CGAL_ROOT}/include/CGAL/version.h" CGAL_VERSION_LINE REGEX "CGAL_VERSION ")
#extract release id
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.?[0-9]*" CGAL_CREATED_VERSION_NUM "${CGAL_VERSION_LINE}")
endif()
endif()
endif()
@ -264,6 +269,7 @@ endif()
# closely to the convoluted versioning code and can adapt without a
# huge diff.
set(CGAL_DOC_VERSION ${CGAL_CREATED_VERSION_NUM})
message(CGAL_DOC_VERSION: ${CGAL_DOC_VERSION})
## generate how_to_cite files
if(PYTHONINTERP_FOUND)

View File

@ -154,6 +154,10 @@ foreach(pkg ${files})
process_package(${pkg})
endif()
endforeach()
if(EXISTS ${GIT_REPO}/Maintenance/release_building/public_release_name)
file(COPY "${GIT_REPO}/Maintenance/release_building/public_release_name"
DESTINATION "${release_dir}/doc")
endif()
#create VERSION
file(WRITE ${release_dir}/VERSION "${CGAL_VERSION}")