From 410ead5f56793752b590aefd8ccb06718cc63603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Dec 2023 17:31:02 +0100 Subject: [PATCH 1/8] also look for Basic viewer in targets --- Installation/cmake/modules/CGAL_add_test.cmake | 5 ++--- .../modules/CGAL_enable_end_of_configuration_hook.cmake | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index a163bca7891f..904e35e25f13 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -124,9 +124,8 @@ function(cgal_add_compilation_test exe_name) if(TARGET CGAL_Qt6_moc_and_resources) # if CGAL_Qt6 was searched, and is header-only get_property(linked_libraries TARGET "${exe_name}" PROPERTY LINK_LIBRARIES) # message(STATUS "${exe_name} depends on ${linked_libraries}") - string(FIND "${linked_libraries}" "CGAL::CGAL_Qt6" link_with_CGAL_Qt6) - if(link_with_CGAL_Qt6 STRGREATER "-1" AND - NOT TARGET "compilation_of__CGAL_Qt6_moc_and_resources") + if( ("CGAL_Qt6" IN_LIST linked_libraries OR "CGAL::CGAL_Qt6" IN_LIST linked_libraries OR "CGAL::CGAL_Basic_viewer" IN_LIST linked_libraries) + AND NOT TARGET "compilation_of__CGAL_Qt6_moc_and_resources") # This custom target is useless. It is used only as a flag to # detect that the test has already been created. add_custom_target("compilation_of__CGAL_Qt6_moc_and_resources") diff --git a/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake b/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake index 9fd8615c2a94..d69c42fc5dda 100644 --- a/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake +++ b/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake @@ -1,5 +1,5 @@ # This module install a hook (with `variable_watch()`) on CMAKE_CURRENT_LIST_DIR -# +# # That uses the non-documented fact that CMAKE_CURRENT_LIST_DIR is cleared # by CMake at the end of the configuration process. So, if the value of # that variable gets empty, that means that CMake has reached the end of @@ -110,7 +110,7 @@ function(CGAL_hook_fix_ctest_depending_on_Qt6) continue() endif() get_property(_target_links TARGET ${_target} PROPERTY LINK_LIBRARIES) - if("CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Qt6" IN_LIST _target_links) + if("CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Basic_viewer" IN_LIST _target_links) set_property(TEST "compilation of ${_target}" APPEND PROPERTY FIXTURES_REQUIRED CGAL_Qt6_moc_and_resources_Fixture) endif() endforeach() From 31d66c332fe3971abef98d1225c3c21d00140bb2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Dec 2023 14:22:01 +0100 Subject: [PATCH 2/8] Fix display of Qt version --- Installation/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 744e4fed4ab1..1e912131c120 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1253,6 +1253,6 @@ if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) "USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'" ) if(Qt6_FOUND) - message(STATUS "USING Qt6_VERSION = '${Qt6Core_VERSION_STRING}'") + message(STATUS "USING Qt6_VERSION = '${Qt6Core_VERSION}'") endif()#Qt6_FOUND endif()#RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE From ad8ad2d190c6a8ad21368abac5de105946d65c0a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Dec 2023 14:38:43 +0100 Subject: [PATCH 3/8] display Qt6 version in the test results page --- Maintenance/test_handling/create_testresult_page | 2 +- Maintenance/test_handling/to_zipped_format | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Maintenance/test_handling/create_testresult_page b/Maintenance/test_handling/create_testresult_page index 3747a4a83133..7cc6ad464c06 100755 --- a/Maintenance/test_handling/create_testresult_page +++ b/Maintenance/test_handling/create_testresult_page @@ -474,7 +474,7 @@ sub print_platform_descriptions() BOOST MPFR GMP -QT5 +QT LEDA CXXFLAGS LDFLAGS diff --git a/Maintenance/test_handling/to_zipped_format b/Maintenance/test_handling/to_zipped_format index d8c7c1cd433b..fdf62712b021 100755 --- a/Maintenance/test_handling/to_zipped_format +++ b/Maintenance/test_handling/to_zipped_format @@ -51,7 +51,7 @@ sub reformat_results($) $_ = $line; open (PLATFORM_INFO,">${platform}.info") or return; open (PLATFORM_NEW_RESULTS,">${platform}.new_results") or return; - my ($CGAL_VERSION,$LEDA_VERSION,$COMPILER,$TESTER_NAME,$TESTER_ADDRESS,$GMP,$MPFR,$ZLIB,$OPENGL,$BOOST,$QT,$QT4,$QT5,$CMAKE) = ("-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","no"); + my ($CGAL_VERSION,$LEDA_VERSION,$COMPILER,$TESTER_NAME,$TESTER_ADDRESS,$GMP,$MPFR,$ZLIB,$OPENGL,$BOOST,$QT,$CMAKE) = ("-","-","-","-","-","-","-","-","-","-","-","-","-","no"); my ($LDFLAGS,$CXXFLAGS) = ("", ""); while (! /^------/) { if(/^\s*$/) { @@ -97,10 +97,13 @@ sub reformat_results($) $QT="$1"; } if (/QT4_VERSION = '([^']+)'/) { - $QT4="$1"; + $QT="$1"; } if (/Qt5_VERSION = '([^']+)'/) { - $QT5="$1"; + $QT="$1"; + } + if (/Qt6_VERSION = '([^']+)'/) { + $QT="$1"; } if (/BOOST_VERSION = '([^']+)'/) { $BOOST="$1"; @@ -147,7 +150,7 @@ $CMAKE $BOOST $MPFR $GMP -$QT5 +$QT $LEDA_VERSION $CXXFLAGS $LDFLAGS From 811f78c6a1d9d6c9cb0585062de0f07b45a558e7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Dec 2023 15:48:09 +0100 Subject: [PATCH 4/8] fix the bug about CGAL_Qt6_moc_and_resources_Fixture --- .../CGAL_CreateSingleSourceCGALProgram.cmake | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake index 2a9fdc4bd870..c51173216b3f 100644 --- a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake +++ b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake @@ -57,12 +57,6 @@ function(create_single_source_cgal_program firstfile ) set(NO_TESTING TRUE) endif() - if(NOT NO_TESTING) - cgal_add_test(${exe_name}) - else() - cgal_add_test(${exe_name} NO_EXECUTION) - endif() - add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${exe_name} ) target_link_libraries(${exe_name} PRIVATE CGAL::CGAL CGAL::Data) @@ -75,13 +69,10 @@ function(create_single_source_cgal_program firstfile ) target_link_libraries(${exe_name} PRIVATE ${CGAL_3RD_PARTY_LIBRARIES}) endif() - if(POLICY CMP0064) - # CMake 3.4 or later - if(NOT NO_TESTING) - cgal_add_test(${exe_name}) - else() - cgal_add_test(${exe_name} NO_EXECUTION) - endif() + if(NOT NO_TESTING) + cgal_add_test(${exe_name}) + else() + cgal_add_test(${exe_name} NO_EXECUTION) endif() else() From aeda27f4050c544b3107c417d78f0fda2752d607 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 9 Jan 2024 13:58:03 +0100 Subject: [PATCH 5/8] "compilation of demo_framework" should be in the Installation package and Polyhedron --- Installation/cmake/modules/CGAL_add_test.cmake | 4 ++-- Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index 904e35e25f13..edc7b43dbee1 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -117,7 +117,7 @@ function(cgal_add_compilation_test exe_name) add_test(NAME "check build system" COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$") set_property(TEST "check build system" - APPEND PROPERTY LABELS "CGAL_build_system") + APPEND PROPERTY LABELS "CGAL_build_system" "Installation") set_property(TEST "check build system" PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture") endif() @@ -133,7 +133,7 @@ function(cgal_add_compilation_test exe_name) add_test(NAME "compilation of CGAL_Qt6_moc_and_resources" COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "CGAL_Qt6_moc_and_resources" --config "$") set_property(TEST "compilation of CGAL_Qt6_moc_and_resources" - APPEND PROPERTY LABELS "CGAL_build_system") + APPEND PROPERTY LABELS "CGAL_build_system" "Installation") set_property(TEST "compilation of CGAL_Qt6_moc_and_resources" PROPERTY FIXTURES_SETUP "CGAL_Qt6_moc_and_resources_Fixture") set_property(TEST "compilation of CGAL_Qt6_moc_and_resources" diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index 91f4f0866374..731986536075 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -45,11 +45,11 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "demo_framework" --config "$") set_property(TEST "compilation of demo_framework" - APPEND PROPERTY LABELS "CGAL_build_system") + APPEND PROPERTY LABELS "CGAL_build_system" "Installation" "${PROJECT_NAME}") set_property(TEST "compilation of demo_framework" APPEND PROPERTY FIXTURES_SETUP "demo_framework_SetupFixture") set_property(TEST "compilation of demo_framework" - APPEND PROPERTY DEPENDS "compilation_of__CGAL_Qt6_moc_and_resources") + APPEND PROPERTY DEPENDS "check build system" "compilation of CGAL_Qt6_moc_and_resources") endif() endif() else() From 1f26c03e3bb23c0906cd9de5273a51310ff5b835 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 10 Jan 2024 16:23:44 +0100 Subject: [PATCH 6/8] plugins should not depend on `Polyhedron_3` --- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp | 2 +- Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake | 3 --- SMDS_3/examples/SMDS_3/c3t3_example.cpp | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 4cadd392fd38..c83911ea93f1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -138,7 +138,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( item->set_valid(false); if(CGAL::SMDS_3::build_triangulation_from_file(in, item->c3t3().triangulation(), - /*verbose = */false, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) + /*verbose = */true, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) { update_c3t3(item->c3t3()); diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index 731986536075..c9ffbd9a93e6 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -61,9 +61,6 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) endif() # Link with CGAL target_link_libraries( ${plugin_name} PUBLIC CGAL::CGAL ) - if(TARGET Polyhedron_3) - add_dependencies( ${plugin_name} Polyhedron_3 ) - endif() if(NOT TARGET CGALlab_all_plugins) add_custom_target(CGALlab_all_plugins) endif() diff --git a/SMDS_3/examples/SMDS_3/c3t3_example.cpp b/SMDS_3/examples/SMDS_3/c3t3_example.cpp index 5ebb5cc3e358..f6d7043c2d03 100644 --- a/SMDS_3/examples/SMDS_3/c3t3_example.cpp +++ b/SMDS_3/examples/SMDS_3/c3t3_example.cpp @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) Triangulation tr; std::ifstream is(filename, std::ios_base::in); - if(!CGAL::IO::read_MEDIT(is, tr)) + if(!CGAL::IO::read_MEDIT(is, tr, CGAL::parameters::verbose(true))) { std::cerr << "Failed to read" << std::endl; return EXIT_FAILURE; From 2ccb65f6eab056004daaae93b09633f7e730a183 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 11 Jan 2024 15:17:26 +0100 Subject: [PATCH 7/8] Revert "plugins should not depend on `Polyhedron_3`" This reverts commit 1f26c03e3bb23c0906cd9de5273a51310ff5b835. --- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp | 2 +- Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake | 3 +++ SMDS_3/examples/SMDS_3/c3t3_example.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index c83911ea93f1..4cadd392fd38 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -138,7 +138,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( item->set_valid(false); if(CGAL::SMDS_3::build_triangulation_from_file(in, item->c3t3().triangulation(), - /*verbose = */true, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) + /*verbose = */false, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) { update_c3t3(item->c3t3()); diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index c9ffbd9a93e6..731986536075 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -61,6 +61,9 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) endif() # Link with CGAL target_link_libraries( ${plugin_name} PUBLIC CGAL::CGAL ) + if(TARGET Polyhedron_3) + add_dependencies( ${plugin_name} Polyhedron_3 ) + endif() if(NOT TARGET CGALlab_all_plugins) add_custom_target(CGALlab_all_plugins) endif() diff --git a/SMDS_3/examples/SMDS_3/c3t3_example.cpp b/SMDS_3/examples/SMDS_3/c3t3_example.cpp index f6d7043c2d03..5ebb5cc3e358 100644 --- a/SMDS_3/examples/SMDS_3/c3t3_example.cpp +++ b/SMDS_3/examples/SMDS_3/c3t3_example.cpp @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) Triangulation tr; std::ifstream is(filename, std::ios_base::in); - if(!CGAL::IO::read_MEDIT(is, tr, CGAL::parameters::verbose(true))) + if(!CGAL::IO::read_MEDIT(is, tr)) { std::cerr << "Failed to read" << std::endl; return EXIT_FAILURE; From 1491b754f7c894f0bddc996df8ace27078748832 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 11 Jan 2024 15:28:40 +0100 Subject: [PATCH 8/8] If CGAL_TEST_SUITE, then plugins do not depend on Polyhedron_3 --- Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index 731986536075..d31b0aa911d3 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -61,7 +61,7 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) endif() # Link with CGAL target_link_libraries( ${plugin_name} PUBLIC CGAL::CGAL ) - if(TARGET Polyhedron_3) + if(NOT CGAL_TEST_SUITE AND TARGET Polyhedron_3) add_dependencies( ${plugin_name} Polyhedron_3 ) endif() if(NOT TARGET CGALlab_all_plugins)