From f9444fa85d8aa3dcd708fc85eed9bfa8064b4fea Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 21 Jul 2021 11:03:36 +0200 Subject: [PATCH] CGAL depends on threads-support... for all compilers! --- .../modules/CGAL_SetupCGALDependencies.cmake | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index 2d9617e447a..84225f4718d 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -102,6 +102,16 @@ function(CGAL_setup_CGAL_dependencies target) target_include_directories(${target} INTERFACE $) + # Make CGAL depend on threads-support (for Epeck and Epeck_d) + if(CGAL_HAS_NO_THREADS) + target_compile_definitions(${target} INTERFACE CGAL_HAS_NO_THREADS) + else() + if(NOT TARGET Threads::Threads) + find_package(Threads REQUIRED) + endif() + target_link_libraries(${target} INTERFACE Threads::Threads) + endif() + # Now setup compilation flags if(MSVC) target_compile_options(${target} INTERFACE @@ -144,14 +154,6 @@ function(CGAL_setup_CGAL_dependencies target) if ( RUNNING_CGAL_AUTO_TEST ) target_compile_options(${target} INTERFACE "-Wall") endif() - if(CGAL_HAS_NO_THREADS) - target_compile_definitions(${target} INTERFACE CGAL_HAS_NO_THREADS) - else() - if(NOT TARGET Threads::Threads) - find_package(Threads REQUIRED) - endif() - target_link_libraries(${target} INTERFACE Threads::Threads) - endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3) message( STATUS "Using gcc version 4 or later. Adding -frounding-math" ) if(CMAKE_VERSION VERSION_LESS 3.3)