From a8b8102567e405f9ad5b4a522baf9633819fc6cc Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 10 Nov 2023 13:17:46 +0100 Subject: [PATCH] CGAL_ENABLE_TESTING has three definitions `CGAL_ENABLE_TESTING` is defined three times: - once in `/CMakeLists.txt` that is the root of the CMake tree for a Git layout - once in `Installation/CMakeLists.txt` that is the root of the CMake for a release tarball, - and once in `CGAL_add_test.cmake`, for consumers of `CGALConfig.cmake`. Two changes: - Add the default value `${BUILD_TESTING}` to all three definitions - Modify the comment --- CMakeLists.txt | 7 ++++--- Installation/CMakeLists.txt | 7 +++++-- Installation/cmake/modules/CGAL_add_test.cmake | 6 +++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66462bfe96e..c7f9ace726f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,9 +46,10 @@ option( message("== CMake setup (DONE) ==\n") -# Enable testing with CGAL_ENABLE_TESTING. Historically, users would enable the tests -# by specifying BUILD_TESTING so if CGAL_ENABLE_TESTING is not enabled, we will set it -# to the value of BUILD_TESTING +# Enable testing with CGAL_ENABLE_TESTING. Before CGAL-6.0, users would enable +# the tests by specifying BUILD_TESTING. For compatibility, If BUILD_TESTING is +# set, that is the default value for CGAL_ENABLE_TESTING. Otherwise, the default +# value is OFF. option(CGAL_ENABLE_TESTING "Build the testing tree." ${BUILD_TESTING}) if(CGAL_ENABLE_TESTING AND NOT POLICY CMP0064) message( diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 5fea17ecb9a..6f49a308bd1 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -105,8 +105,11 @@ else(CGAL_BRANCH_BUILD) "${CGAL_SOURCE_DIR}" CACHE INTERNAL "Directory containing the GraphicsView package") - # Enable testing with CGAL_ENABLE_TESTING - option(CGAL_ENABLE_TESTING "Build the testing tree." OFF) +# Enable testing with CGAL_ENABLE_TESTING. Before CGAL-6.0, users would enable +# the tests by specifying BUILD_TESTING. For compatibility, If BUILD_TESTING is +# set, that is the default value for CGAL_ENABLE_TESTING. Otherwise, the default +# value is OFF. +option(CGAL_ENABLE_TESTING "Build the testing tree." ${BUILD_TESTING}) if(CGAL_ENABLE_TESTING) enable_testing() endif() diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index 1f2d35ade0c..8304207ec83 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -3,7 +3,11 @@ if(CGAL_add_test_included) endif(CGAL_add_test_included) set(CGAL_add_test_included TRUE) -option(CGAL_ENABLE_TESTING "Build the testing tree." OFF) +# Enable testing with CGAL_ENABLE_TESTING. Before CGAL-6.0, users would enable +# the tests by specifying BUILD_TESTING. For compatibility, If BUILD_TESTING is +# set, that is the default value for CGAL_ENABLE_TESTING. Otherwise, the default +# value is OFF. +option(CGAL_ENABLE_TESTING "Build the testing tree." ${BUILD_TESTING}) if(CGAL_ENABLE_TESTING) enable_testing()