From 80daf54be16e31bfe1062e46266272ddd2c478f7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 21 Jul 2020 11:23:22 +0200 Subject: [PATCH 1/7] Remove leading zeros in CGAL_BUILD_VERSION: 1 instead of 001 --- Installation/cmake/modules/CGAL_parse_version_h.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Installation/cmake/modules/CGAL_parse_version_h.cmake b/Installation/cmake/modules/CGAL_parse_version_h.cmake index fa0b22cd316..0b6a774b734 100644 --- a/Installation/cmake/modules/CGAL_parse_version_h.cmake +++ b/Installation/cmake/modules/CGAL_parse_version_h.cmake @@ -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() From 63b5b30fdf4c18c5adb6e136dd396ba6b4bb2358 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 21 Jul 2020 11:24:09 +0200 Subject: [PATCH 2/7] No longer parse CGAL/version.h to get the version numbers --- Installation/lib/cmake/CGAL/CGALConfig.cmake | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index 11ff7810d31..bb1a0c43c6f 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -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) From ed377100ee42b9d81d262f8049c14105c49d1c1c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 21 Jul 2020 11:24:48 +0200 Subject: [PATCH 3/7] Read CGAL_BUILD_VERSION from another file That allows the release creation script to fill that number. --- Installation/lib/cmake/CGAL/CGALConfigBuildVersion.cmake | 1 + Installation/lib/cmake/CGAL/CGALConfigVersion.cmake | 4 ++++ .../developer_scripts/cgal_create_release_with_cmake.cmake | 2 ++ 3 files changed, 7 insertions(+) create mode 100644 Installation/lib/cmake/CGAL/CGALConfigBuildVersion.cmake diff --git a/Installation/lib/cmake/CGAL/CGALConfigBuildVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigBuildVersion.cmake new file mode 100644 index 00000000000..c6ef85cf991 --- /dev/null +++ b/Installation/lib/cmake/CGAL/CGALConfigBuildVersion.cmake @@ -0,0 +1 @@ +set(CGAL_BUILD_VERSION 0) diff --git a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake index e0ff35433ce..56f87945869 100644 --- a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake @@ -1,6 +1,10 @@ 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_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}") diff --git a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake index 16a584ad6eb..aa6d602eb71 100644 --- a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake +++ b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake @@ -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}") From 4b489b4c02927c34d68c282cc6bc790f3d5120a2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 21 Jul 2020 11:55:49 +0200 Subject: [PATCH 4/7] Replace --is_master by --integration The old option was completely useless: it was ON by default, and had a flag to set it ON again! --- Scripts/developer_scripts/create_new_release | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Scripts/developer_scripts/create_new_release b/Scripts/developer_scripts/create_new_release index 4a017ea4281..297abe094f4 100755 --- a/Scripts/developer_scripts/create_new_release +++ b/Scripts/developer_scripts/create_new_release @@ -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 : followed by a number. When used with --public, will modify + printerr ' --beta : followed by a number. When used with --public, will modify the release number and the release version name to include beta' 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 ' : the directory containing the packages [default is trunk]' } @@ -103,8 +103,8 @@ while [ $1 ]; do DESTINATION=$1 shift;continue ;; - --is_master) - IS_MASTER="y" + --integration) + INTEGRATION="y" shift;continue ;; -*) @@ -116,9 +116,9 @@ while [ $1 ]; do 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" @@ -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}" From 5b89f55ebc1e1e4ab95ada17b0b29256daeabb7f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 21 Jul 2020 11:56:47 +0200 Subject: [PATCH 5/7] Automatic whitespace adjustments by my editor --- .../cgal_create_release_with_cmake.cmake | 2 +- Scripts/developer_scripts/create_new_release | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake index aa6d602eb71..2bcf27c3768 100644 --- a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake +++ b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake @@ -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 if the release is a beta. # CGAL_VERSION_NR=release string used to update version.h. Must be something like 1041200033 , or 104120090 # TESTSUITE=indicate if the release is meant to be used by the testsuite, default if OFF diff --git a/Scripts/developer_scripts/create_new_release b/Scripts/developer_scripts/create_new_release index 297abe094f4..3add47b0ca2 100755 --- a/Scripts/developer_scripts/create_new_release +++ b/Scripts/developer_scripts/create_new_release @@ -99,7 +99,7 @@ while [ $1 ]; do continue ;; --dest) - shift + shift DESTINATION=$1 shift;continue ;; @@ -111,7 +111,7 @@ while [ $1 ]; do printerr "Unrecognized option : $1" exit ;; - *) + *) if [ -z "$SOURCES_DIR_HAS_BEEN_SET" ]; then SOURCES_DIR="$1" SOURCES_DIR_HAS_BEEN_SET=y @@ -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="" From 5588cdfcd7bc66908139ed200972d970c2e82646 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 21 Jul 2020 18:04:49 +0200 Subject: [PATCH 6/7] Bug! Install CGALConfigBuildVersion.cmake with the other files --- Installation/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 3556338d667..272431c72dc 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -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") From 23f8f46b31fe2003cd281a6fc039a9fa34c3f7af Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 21 Jul 2020 18:05:01 +0200 Subject: [PATCH 7/7] Fix for the tests in test/Installation/CMakeLists.txt --- Installation/lib/cmake/CGAL/CGALConfigVersion.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake index 56f87945869..5b2fade66df 100644 --- a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake @@ -3,7 +3,10 @@ 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_BUILD_VERSION ${CGAL_BUILD_VERSION} PARENT_SCOPE) + 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}")