From f5b776b747075978efed85d2cfaec82d24299af2 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 11 Dec 2020 10:11:43 -0500 Subject: [PATCH] VTK-m Properly computes frameworks on mojave / big sur Fixes #587 This works around issues in CMake 3.19 and lower which aren't aware of the new 'tbd' files that should be used for GLUT --- CMake/VTKmRenderingContexts.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMake/VTKmRenderingContexts.cmake b/CMake/VTKmRenderingContexts.cmake index 635e650c8..6d0309485 100644 --- a/CMake/VTKmRenderingContexts.cmake +++ b/CMake/VTKmRenderingContexts.cmake @@ -61,6 +61,20 @@ function(vtkm_find_gl) if(DO_GLUT_FIND AND NOT TARGET GLUT::GLUT) find_package(GLUT ${GLUT_REQUIRED} ${QUIETLY}) + + if(APPLE AND CMAKE_VERSION VERSION_LESS 3.19.2) + get_target_property(lib_path GLUT::GLUT IMPORTED_LOCATION) + if(EXISTS "${lib_path}.tbd") + set_target_properties(GLUT::GLUT PROPERTIES + IMPORTED_LOCATION "${lib_path}.tbd") + endif() + + get_target_property(lib_path GLUT::Cocoa IMPORTED_LOCATION) + if(EXISTS "${lib_path}.tbd") + set_target_properties(GLUT::Cocoa PROPERTIES + IMPORTED_LOCATION "${lib_path}.tbd") + endif() + endif() endif() endfunction()