From f45c16f815ba01c7be73c6acd930308ae945c779 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 25 Jul 2019 15:34:03 +0200 Subject: [PATCH] Add a new custom target ALL_CGAL_TARGETS to track all targets That will include also targets with `EXCLUDE_FROM_ALL`. --- Installation/CMakeLists.txt | 7 ++++++- Installation/cmake/modules/CGAL_add_test.cmake | 4 ++++ Installation/src/CMakeLists.txt | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 7084d430d83..2ab41173d4f 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -959,12 +959,17 @@ endif() # #-------------------------------------------------------------------------------------------------- +if(NOT TARGET ALL_CGAL_TARGETS) + add_custom_target( ALL_CGAL_TARGETS ) +endif() + macro( add_programs subdir target ON_OFF ) cache_set( CGAL_EXECUTABLE_TARGETS "" ) add_custom_target( ${target} ) - + add_dependencies( ALL_CGAL_TARGETS ${target} ) + option( WITH_${target} "Select ${target}" ${ON_OFF} ) if ( WITH_${target} ) add_subdirectory( ${subdir} EXCLUDE_FROM_ALL ) diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index c25390304d7..057a603a050 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -98,8 +98,12 @@ function(cgal_add_compilation_test exe_name) COMMAND ${TIME_COMMAND} "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "${exe_name}") set_property(TEST "compilation_of__${exe_name}" APPEND PROPERTY LABELS "${PROJECT_NAME}") + if(NOT TARGET ALL_CGAL_TARGETS) + add_custom_target( ALL_CGAL_TARGETS ) + endif() 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" diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index 09db484fd6e..7ed919fab92 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -72,7 +72,10 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) # CMakeLists.txt can be the target like if it was an imported # target. add_library(CGAL::${LIBRARY_NAME} ALIAS ${LIBRARY_NAME}) - + if(NOT TARGET ALL_CGAL_TARGETS) + add_custom_target( ALL_CGAL_TARGETS ) + endif() + add_dependencies( ALL_CGAL_TARGETS ${LIBRARY_NAME} ) if(CGAL_AUTO_LINK_ENABLED) if (NOT CGAL_HEADER_ONLY) set_target_properties( ${LIBRARY_NAME} PROPERTIES