diff --git a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt index 74f626a1326..e32b5684c6f 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt +++ b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt @@ -32,3 +32,10 @@ else() endif() +if(BUILD_TESTING) + set_tests_properties( + execution___of__test_Circular_kernel_basic + execution___of__test_Exact_circular_kernel_basic + PROPERTIES RESOURCE_LOCK Circular_kernel_basic) +endif() + diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt index 891a5b6d017..3c269a89f9c 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,4 +1,3 @@ - cmake_minimum_required(VERSION 3.1...3.15) project (Hyperbolic_triangulation_2_Demo) @@ -15,15 +14,10 @@ endif() find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core Qt5) find_package(LEDA QUIET) -find_package(Qt5 QUIET COMPONENTS Widgets) - -include_directories (BEFORE include) - if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND)) # ui files, created with Qt Designer qt5_wrap_ui( UIS HDT2.ui ) - # qrc files (resources files, that contain icons, at least) qt5_add_resources ( RESOURCE_FILES resources/Delaunay_triangulation_2.qrc ) # cpp files diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index fe7c45751d1..5579413e177 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -95,7 +95,7 @@ function(cgal_add_compilation_test exe_name) return() endif() add_test(NAME "compilation_of__${exe_name}" - COMMAND ${TIME_COMMAND} "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "${exe_name}") + COMMAND ${TIME_COMMAND} "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "${exe_name}" --config "$") set_property(TEST "compilation_of__${exe_name}" APPEND PROPERTY LABELS "${PROJECT_NAME}") if(NOT TARGET ALL_CGAL_TARGETS) @@ -107,7 +107,7 @@ function(cgal_add_compilation_test exe_name) 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") + COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$") set_property(TEST "check_build_system" APPEND PROPERTY LABELS "Installation") if(POLICY CMP0066) # cmake 3.7 or later 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 e0f001f0d4b..5909d3fc525 100644 --- a/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake +++ b/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake @@ -18,10 +18,12 @@ function(CGAL_run_at_the_end_of_configuration variable access value current_list return() endif() if(current_list_file STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" - OR NOT stack STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" - OR stack MATCHES doc/CMakeLists.txt - OR stack MATCHES demo/Polyhedron/) - return() + AND NOT current_list_file STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" + OR NOT stack STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" + AND stack STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" + OR stack MATCHES doc/CMakeLists.txt + OR stack MATCHES demo/Polyhedron/) + return() endif() get_property(_targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS) if(CGAL_CHECK_UNREFERENCES_TARGETS) @@ -47,7 +49,9 @@ function(CGAL_run_at_the_end_of_configuration variable access value current_list endif() endforeach() endif() - if(CGAL_CHECK_UNUSED_CPP_FILES) + if(CGAL_CHECK_UNUSED_CPP_FILES + AND NOT current_list_file STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" + AND stack STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt") file(GLOB _cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) if(_targets AND _cppfiles) set(_sources) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 3f05050bd45..40a606b3124 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -113,3 +113,9 @@ if(TARGET ceres) target_link_libraries( test_mesh_smoothing PRIVATE ceres ) endif(TARGET ceres) +if(BUILD_TESTING) + set_tests_properties( + execution___of__triangulate_hole_Polyhedron_3_no_delaunay_test + execution___of__triangulate_hole_Polyhedron_3_test + PROPERTIES RESOURCE_LOCK Triangulation_with_hole) +endif() diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index 866dcf9f74f..fc4afa3bb09 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -1,5 +1,3 @@ -# This is the CMake script for compiling the CGAL Polyhedron demo. - cmake_minimum_required(VERSION 3.1...3.15) project( Polyhedron_Demo ) @@ -196,6 +194,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) target_link_libraries(demo_framework PUBLIC Qt5::OpenGL Qt5::Widgets Qt5::Gui Qt5::Script ) + cgal_add_compilation_test(demo_framework) # Let's define `three_EXPORT` during the compilation of `demo_framework`, # in addition of `demo_framework_EXPORT` (defined automatically by # CMake). That is to deal with the visibility of symbols of @@ -224,12 +223,21 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) target_link_libraries(point_dialog PUBLIC Qt5::OpenGL Qt5::Gui Qt5::Script Qt5::Widgets) + add_custom_target(all_scene_items) + if(BUILD_TESTING) + cgal_add_compilation_test(all_scene_items) + set_property(TEST compilation_of__all_scene_items + APPEND PROPERTY DEPENDS compilation_of__demo_framework) + set_property(TEST compilation_of__all_scene_items + APPEND PROPERTY TIMEOUT 1700) + endif(BUILD_TESTING) + macro(add_item item_name) add_library(${item_name} SHARED ${ARGN}) target_link_libraries(${item_name} PUBLIC demo_framework ${CGAL_LIBRARIES} Qt5::OpenGL Qt5::Gui Qt5::Script Qt5::Widgets) - cgal_add_compilation_test(${item_name}) + add_dependencies(all_scene_items ${item_name}) add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${item_name} ) endmacro(add_item) @@ -322,7 +330,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_executable ( Polyhedron_3 Polyhedron_3.cpp ) target_link_libraries( Polyhedron_3 PRIVATE polyhedron_demo ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyhedron_3 ) - cgal_add_compilation_test(polyhedron_demo) if( POLYHEDRON_QTSCRIPT_DEBUGGER ) if(TARGET Qt5::ScriptTools) diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index 303b9922f0e..26a2cfbb09c 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -28,7 +28,10 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) PROPERTY LIBRARY_OUTPUT_DIRECTORY "${CGAL_POLYHEDRON_DEMO_PLUGINS_DIR}") cgal_add_compilation_test(${plugin_name}) - + if(BUILD_TESTING) + set_property(TEST compilation_of__${plugin_name} + APPEND PROPERTY DEPENDS compilation_of__test_items) + endif() add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${plugin_name} ) # Link with Qt target_link_libraries( ${plugin_name} PUBLIC ${QT_LIBRARIES} ) diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt index 609cbec4045..8d05659de66 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt @@ -15,6 +15,8 @@ endif() find_package(CGAL COMPONENTS Qt5) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Widgets Svg) include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)