Merge pull request #2463 from sloriot/Doc-set_version

Set CGAL version when building doc alone
This commit is contained in:
Laurent Rineau 2017-10-13 17:06:53 +02:00
commit 7b73dbfc55
1 changed files with 19 additions and 0 deletions

View File

@ -238,6 +238,25 @@ else()
set(CGAL_RELEASE_YEAR_ID "${CGAL_BUILD_YEAR2}a")
endif()
if (NOT CGAL_CREATED_VERSION_NUM)
if (CGAL_BRANCH_BUILD)
file(STRINGS "${CGAL_ROOT}/Maintenance/release_building/MAJOR_NUMBER" CGAL_MAJOR_VERSION REGEX "[0-9]*")
file(STRINGS "${CGAL_ROOT}/Maintenance/release_building/MINOR_NUMBER" CGAL_MINOR_VERSION REGEX "[0-9]*")
file(STRINGS "${CGAL_ROOT}/Maintenance/release_building/BUGFIX_NUMBER" CGAL_BUGFIX_VERSION REGEX "[0-9]*")
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}")
else()
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]*(-Ic-)?[0-9]*" CGAL_CREATED_VERSION_NUM "${CGAL_VERSION_LINE}")
endif()
endif()
# Introduce our own version variable. This way we avoid tying this too
# closely to the convoluted versioning code and can adapt without a
# huge diff.