Merge branch 'releases/CGAL-5.0-branch'

This commit is contained in:
Laurent Rineau 2020-05-18 12:01:39 +02:00
commit 81c1b96217
19 changed files with 118 additions and 28 deletions

1
CGALConfigVersion.cmake Normal file
View File

@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake)

View File

@ -10,6 +10,7 @@ export(PACKAGE CGAL)
set( CGAL_BRANCH_BUILD ON CACHE INTERNAL "Create CGAL from a Git branch" FORCE)
include(${CMAKE_SOURCE_DIR}/CGALConfigVersion.cmake)
include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake)
CGAL_detect_git(${CMAKE_SOURCE_DIR})

View File

@ -252,9 +252,7 @@ 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]*")
include(${CGAL_ROOT}/CGALConfigVersion.cmake)
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}")

View File

@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigVersion.cmake)

View File

@ -20,7 +20,7 @@ if(POLICY CMP0056)
cmake_policy(SET CMP0056 NEW)
endif()
# Use GNUInstallDirst to get canonical paths
# Use GNUInstallDirs to get canonical paths
include(GNUInstallDirs)
#--------------------------------------------------------------------------------------------------
@ -135,10 +135,6 @@ if ( CGAL_BRANCH_BUILD )
# Create version files
#
file(STRINGS "${CGAL_MAINTENANCE_PACKAGE_DIR}/release_building/MAJOR_NUMBER" CGAL_MAJOR_VERSION REGEX "[0-9]*")
file(STRINGS "${CGAL_MAINTENANCE_PACKAGE_DIR}/release_building/MINOR_NUMBER" CGAL_MINOR_VERSION REGEX "[0-9]*")
file(STRINGS "${CGAL_MAINTENANCE_PACKAGE_DIR}/release_building/BUGFIX_NUMBER" CGAL_BUGFIX_VERSION REGEX "[0-9]*")
file(REMOVE ${CMAKE_BINARY_DIR}/VERSION)
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}")
@ -765,11 +761,11 @@ set ( CGAL_INSTALL_CMAKE_DIR "${CGAL_INSTALL_LIB_DIR}/cmake/CGAL"
CACHE STRING "The folder where CGAL CMake modules will be installed, relative to CMAKE_INSTALL_PREFIX"
)
set ( CGAL_INSTALL_DOC_DIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${CGAL_VERSION_DIR}"
set ( CGAL_INSTALL_DOC_DIR "${CMAKE_INSTALL_DOCDIR}"
CACHE STRING "The folder where CGAL documentation and license files will be installed, relative to CMAKE_INSTALL_PREFIX"
)
set ( CGAL_INSTALL_MAN_DIR "${CMAKE_INSTALL_DATAROOTDIR}/man/man1"
set ( CGAL_INSTALL_MAN_DIR "${CMAKE_INSTALL_MANDIR}/man1"
CACHE STRING "The folder where manual pages for CGAL scripts will be installed, relative to CMAKE_INSTALL_PREFIX"
)
@ -863,6 +859,8 @@ if(NOT CGAL_HEADER_ONLY)
else()
configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in"
"${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY)
configure_file("${CGAL_MODULES_DIR}/CGALConfigVersion_binary_header_only.cmake.in"
"${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake" @ONLY)
endif()
#--------------------------------------------------------------------------------------------------
@ -916,12 +914,17 @@ if(NOT CGAL_HEADER_ONLY)
${CMAKE_BINARY_DIR}/config/CGALConfig.cmake
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
else()
configure_file(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake)
install(FILES
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake
${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
${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")
configure_file(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake)
install(FILES
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake
DESTINATION ${CGAL_INSTALL_CMAKE_DIR})
endif()
endif()
if(CGAL_INSTALL_MAN_DIR)
@ -1369,4 +1372,3 @@ if(NOT CGAL_BRANCH_BUILD AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doc")
# in a non-branch build this is the top-level CMakeLists.txt
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/doc")
endif()

View File

@ -0,0 +1,5 @@
#
# This file points to the CGALConfigVersion.cmake for header-only CGAL.
#
include(@CGAL_INSTALLATION_PACKAGE_DIR@/lib/cmake/CGAL/CGALConfigVersion.cmake)

View File

@ -397,7 +397,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
# CGALConfig.cmake is platform specific so it is generated and stored in the binary folder.
configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary.cmake.in" "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY)
write_basic_package_version_file("${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake"
VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUILD_VERSION}"
VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}"
COMPATIBILITY SameMajorVersion)
# There is also a version of CGALConfig.cmake that is prepared in case CGAL in installed in CMAKE_INSTALL_PREFIX.

View File

@ -104,12 +104,10 @@ function(cgal_add_compilation_test exe_name)
if(NOT TARGET cgal_check_build_system)
add_custom_target(cgal_check_build_system)
add_dependencies( ALL_CGAL_TARGETS cgal_check_build_system )
endif()
if(NOT TEST check_build_system)
add_test(NAME "check_build_system"
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$<CONFIG>")
set_property(TEST "check_build_system"
APPEND PROPERTY LABELS "Installation")
APPEND PROPERTY LABELS "${PROJECT_NAME}")
if(POLICY CMP0066) # cmake 3.7 or later
set_property(TEST "check_build_system"
PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture")

View File

@ -11,7 +11,8 @@ function(cgal_parse_version_h version_h_file name)
# CMAKE_MATCH_3 and CMAKE_MATCH_4 corresponds to the two sub-expressions
# of the alternative, and cannot be non-empty at the same time.
set(${ARGV2} "${CMAKE_MATCH_3}${CMAKE_MATCH_4}" PARENT_SCOPE) # major version
set(${ARGV3} "${CMAKE_MATCH_5}" PARENT_SCOPE) # minor version
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
endfunction()

View File

@ -1,4 +1,4 @@
#
#
# This file is the CGALConfig.cmake for a header-only CGAL installation
#
@ -53,6 +53,9 @@ else()
if(NOT EXISTS ${CGAL_ROOT}/include/CGAL/config.h)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
endif()
if(NOT EXISTS ${CGAL_ROOT}/include/CGAL/config.h)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
endif()
endif()
# not BRANCH_BUILD: it can be an installed CGAL, or the tarball layout
if(EXISTS ${CGAL_CONFIG_DIR}/CGAL_add_test.cmake)

View File

@ -0,0 +1,22 @@
set(CGAL_MAJOR_VERSION 5)
set(CGAL_MINOR_VERSION 1)
set(CGAL_BUGFIX_VERSION 0)
set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "5.1-dev")
set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}")
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()
set(PACKAGE_VERSION ${CGAL_CREATED_VERSION_NUM})
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

View File

@ -99,3 +99,38 @@ else()
message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.")
endif()
function(CGAL_installation_test_find_package_version mode)
set(EXACT)
if(mode STREQUAL "less")
MATH(EXPR CGAL_MAJOR_VERSION "${CGAL_MAJOR_VERSION} - 1")
endif()
if(mode STREQUAL "greater" OR mode STREQUAL "fail-exact")
MATH(EXPR CGAL_MINOR_VERSION "${CGAL_MINOR_VERSION} + 1")
endif()
if(mode STREQUAL "exact" OR mode STREQUAL "fail-exact")
set(EXACT "EXACT ")
endif()
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
set(VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}")
else()
set(VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}")
endif()
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode}")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode})
configure_file(test_find_package.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode}/CMakeLists.txt)
add_test(NAME test_find_package_version_${mode}
COMMAND ${CMAKE_COMMAND} -S ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode} -B ${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode})
cgal_setup_test_properties(test_find_package_version_${mode})
endfunction()
CGAL_installation_test_find_package_version(less)
CGAL_installation_test_find_package_version(equal)
CGAL_installation_test_find_package_version(greater)
CGAL_installation_test_find_package_version(exact)
CGAL_installation_test_find_package_version(fail-exact)
set_tests_properties(
test_find_package_version_greater
test_find_package_version_fail-exact
PROPERTIES WILL_FAIL TRUE)

View File

@ -0,0 +1,14 @@
cmake_minimum_required(VERSION ${CMAKE_VERSION})
project( test_find_package_${mode} )
find_package(CGAL ${VERSION} ${EXACT}REQUIRED
PATHS ${CGAL_DIR}
NO_DEFAULT_PATH
NO_PACKAGE_ROOT_PATH
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_PACKAGE_REGISTRY
NO_CMAKE_BUILDS_PATH
NO_CMAKE_SYSTEM_PATH
NO_CMAKE_SYSTEM_PACKAGE_REGISTRY
)

View File

@ -1 +0,0 @@
0

View File

@ -1 +0,0 @@
5

View File

@ -1 +0,0 @@
1

View File

@ -1 +0,0 @@
CGAL-5.1-dev

View File

@ -180,9 +180,13 @@ else
fi
# Set the major/minor/bugfix release numbers
NUMBERS_DIR=${SOURCES_DIR}/Maintenance/release_building
MAJOR_NUMBER=`cat ${NUMBERS_DIR}/MAJOR_NUMBER` # 2 digits max
MINOR_NUMBER=`cat ${NUMBERS_DIR}/MINOR_NUMBER` # 2 digits max
BUGFIX_NUMBER=`cat ${NUMBERS_DIR}/BUGFIX_NUMBER` # 1 digit max
if [ -f ${NUMBERS_DIR}/MAJOR_NUMBER ]; then
MAJOR_NUMBER=`cat ${NUMBERS_DIR}/MAJOR_NUMBER` # 2 digits max
MINOR_NUMBER=`cat ${NUMBERS_DIR}/MINOR_NUMBER` # 2 digits max
BUGFIX_NUMBER=`cat ${NUMBERS_DIR}/BUGFIX_NUMBER` # 1 digit max
else
eval $(cmake -DCGALCONFIGVERSIONFILE=${SOURCES_DIR}/CGALConfigVersion.cmake -P ${SOURCES_DIR}/Scripts/developer_scripts/create_new_release_evaluate_versions.cmake 2>&1)
fi
# Do not show the bugfix number if it is 0.
if [ x"$BUGFIX_NUMBER" != "x0" ]; then
@ -302,6 +306,9 @@ if [ -n "$DO_PUBLIC" ]; then
else
public_release_name="CGAL-${public_release_version}"
fi
if ! [ -f ${NUMBERS_DIR}/MAJOR_NUMBER ]; then
eval $(cmake -DCGALCONFIGVERSIONFILE=${SOURCES_DIR}/CGALConfigVersion.cmake -P ${SOURCES_DIR}/Scripts/developer_scripts/create_new_release_evaluate_versions.cmake 2>&1)
fi
cmake -DGIT_REPO=${SOURCES_DIR} -DGENERATE_TARBALLS="ON" -DPUBLIC="ON" -DDESTINATION="${DESTINATION}" -DCGAL_VERSION="${public_release_version}" -DCGAL_VERSION_NR="${public_release_number}" -DVERBOSE="${VERBOSE}" -P ${SOURCES_DIR}/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake
tar -xf ${public_release_name}.tar.xz

View File

@ -0,0 +1,6 @@
include(${CGALCONFIGVERSIONFILE})
message("MAJOR_NUMBER=${CGAL_MAJOR_VERSION}
MINOR_NUMBER=${CGAL_MINOR_VERSION}
BUGFIX_NUMBER=${CGAL_BUGFIX_VERSION}
public_release_version=${CGAL_VERSION_PUBLIC_RELEASE_VERSION}
public_release_name=${CGAL_VERSION_PUBLIC_RELEASE_NAME}")