Merge pull request #4860 from lrineau/CGAL-CGALConfigVersion__fixes-GF

CGALConfigVersion... fix #4850
This commit is contained in:
Laurent Rineau 2020-07-23 17:15:09 +02:00
commit c788d66761
7 changed files with 26 additions and 23 deletions

View File

@ -879,6 +879,7 @@ if(NOT CGAL_HEADER_ONLY)
else()
install(FILES
${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake
${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigBuildVersion.cmake
${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigVersion.cmake
DESTINATION ${CGAL_INSTALL_CMAKE_DIR})
if(NOT CGAL_INSTALL_CMAKE_DIR STREQUAL "${CGAL_INSTALL_LIB_DIR}/cmake/CGAL")

View File

@ -14,5 +14,6 @@ function(cgal_parse_version_h version_h_file name)
MATH(EXPR ${ARGV3} "${CMAKE_MATCH_5}") # minor version without leading 0
set(${ARGV3} "${${ARGV3}}" PARENT_SCOPE)
set(${ARGV4} "${CMAKE_MATCH_6}" PARENT_SCOPE) # patch number
set(${ARGV5} "${CMAKE_MATCH_7}" PARENT_SCOPE) # build number
MATH(EXPR ${ARGV5} "${CMAKE_MATCH_7}") # build number version without leading 0
set(${ARGV5} "${${ARGV5}}" PARENT_SCOPE) # build number
endfunction()

View File

@ -161,15 +161,6 @@ cgal_setup_module_path()
set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake)
include("${CGAL_MODULES_DIR}/CGAL_parse_version_h.cmake")
cgal_parse_version_h( "${CGAL_INSTALLATION_PACKAGE_DIR}/include/CGAL/version.h"
"CGAL_VERSION_NAME"
"CGAL_MAJOR_VERSION"
"CGAL_MINOR_VERSION"
"CGAL_BUGFIX_VERSION"
"CGAL_BUILD_VERSION")
set(CGAL_VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}.${CGAL_BUILD_VERSION}")
if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST )
# Do not use -isystem for CGAL include paths
set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE)

View File

@ -0,0 +1 @@
set(CGAL_BUILD_VERSION 0)

View File

@ -1,6 +1,13 @@
set(CGAL_MAJOR_VERSION 5)
set(CGAL_MINOR_VERSION 1)
set(CGAL_BUGFIX_VERSION 0)
include(${CMAKE_CURRENT_LIST_DIR}/CGALConfigBuildVersion.cmake)
if(NOT CMAKE_SCRIPT_MODE_FILE)
set(CGAL_MAJOR_VERSION ${CGAL_MAJOR_VERSION} PARENT_SCOPE)
set(CGAL_MINOR_VERSION ${CGAL_MINOR_VERSION} PARENT_SCOPE)
set(CGAL_BUGFIX_VERSION ${CGAL_BUGFIX_VERSION} PARENT_SCOPE)
set(CGAL_BUILD_VERSION ${CGAL_BUILD_VERSION} PARENT_SCOPE)
endif()
set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "5.1-beta2")
set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}")

View File

@ -3,7 +3,7 @@
# DESTINATION the path where the release is created, default is /tmp
# PUBLIC=[ON/OFF] indicates if a public release should be built, default is OFF
# VERBOSE=[ON/OFF] makes the script more verbose, default is OFF
# CGAL_VERSION=release id used to update version.h, VERSION and the release directory. Can be 4.12-Ic-33, 4.12-I-32, 4.12, ...
# CGAL_VERSION=release id used to update version.h, VERSION and the release directory. Can be 4.12-Ic-33, 4.12-I-32, 4.12, ...
# Must be followed by -beta<beta_number> if the release is a beta.
# CGAL_VERSION_NR=release string used to update version.h. Must be something like 1041200033 , or 10412009<beta number>0
# TESTSUITE=indicate if the release is meant to be used by the testsuite, default if OFF
@ -182,6 +182,8 @@ string(REPLACE "CGAL_VERSION ${CGAL_VERSION_INPUT}" "CGAL_VERSION ${CGAL_VERSION
# update CGAL_VERSION_NR
if (CGAL_VERSION_NR)
string(REGEX REPLACE "CGAL_VERSION_NR 10[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" "CGAL_VERSION_NR ${CGAL_VERSION_NR}" file_content "${file_content}")
math(EXPR CGAL_BUILD_VERSION "${CGAL_VERSION_NR} % 10000")
file(WRITE ${release_dir}/lib/cmake/CGAL/CGALConfigBuildVersion.cmake "set(CGAL_BUILD_VERSION ${CGAL_BUILD_VERSION})")
endif()
file(WRITE ${release_dir}/include/CGAL/version.h "${file_content}")

View File

@ -22,7 +22,7 @@ SOURCES_DIR="$PWD" # Directory containing the sources, default is "$PWD"
VERBOSE="" # Verbose mode (displays log to standard err)
BETA="" #If set, will change the release number and version number accordingly.
DESTINATION="$PWD"
IS_MASTER="y"
INTEGRATION=""
SOURCES_DIR_HAS_BEEN_SET=
@ -45,10 +45,10 @@ usage() {
printerr ' --no-testsuite : when used with --do-it, the tag is made, files are published,'
printerr ' but the LATEST file is not updated.'
printerr ' --verbose : print log to standard output, instead of the log file'
printerr ' --beta <n> : followed by a number. When used with --public, will modify
printerr ' --beta <n> : followed by a number. When used with --public, will modify
the release number and the release version name to include beta<n>'
printerr ' --dest : followed by the path to where the release should be created. Default is /tmp.'
printerr ' --is_master : replace the Ic in the name by I.'
printerr ' --integration : replace the I in the name by Ic.'
printerr ' <packages dir> : the directory containing the packages [default is trunk]'
}
@ -99,26 +99,26 @@ while [ $1 ]; do
continue
;;
--dest)
shift
shift
DESTINATION=$1
shift;continue
;;
--is_master)
IS_MASTER="y"
--integration)
INTEGRATION="y"
shift;continue
;;
-*)
printerr "Unrecognized option : $1"
exit
;;
*)
*)
if [ -z "$SOURCES_DIR_HAS_BEEN_SET" ]; then
SOURCES_DIR="$1"
SOURCES_DIR_HAS_BEEN_SET=y
shift; continue
elif [ -n "$IS_MASTER" ]; then
elif [ -z "$INTEGRATION" ]; then
# Compatibility with the old syntax with candidates
IS_MASTER=""
INTEGRATION="y"
shift; continue
else
printerr "Unrecognized option : $1"
@ -159,7 +159,7 @@ if [ -z "$VERBOSE" ]; then
exec 3>&1 >> ${LOGFILE}
fi
# Verbose: displays all executed commands
# Verbose: displays all executed commands
#PS4='[${LINENO}]+ '
#set -x
@ -189,7 +189,7 @@ else
fi
# Do not show the bugfix number if it is 0.
if [ x"$BUGFIX_NUMBER" != "x0" ]; then
if [ x"$BUGFIX_NUMBER" != "x0" ]; then
BUGFIX_STRING=".$BUGFIX_NUMBER"
else
BUGFIX_STRING=""
@ -206,7 +206,7 @@ if [ -z "$INTERNAL_NUMBER" ]; then
INTERNAL_NUMBER=1
fi
if [ -z "${IS_MASTER}" ]; then
if [ -n "${INTEGRATION}" ]; then
INTERNAL_STRING="-Ic-${INTERNAL_NUMBER}"
else
INTERNAL_STRING="-I-${INTERNAL_NUMBER}"