From 020e5bc7093a8a07b89edd92e6c12496457b7ad6 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 21 Jan 2021 14:47:50 +0100 Subject: [PATCH] CMake: workaround for possibly failing OpenGL check in vtk9 --- CMakeLists.txt | 7 ++++++- cMake/FreeCAD_Helpers/PrintFinalReport.cmake | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4dabf7657a7..5b177362e649 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,12 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) find_package(ZLIB REQUIRED) find_package(PyCXX REQUIRED) SetupOpenCasCade() + if(BUILD_GUI) + # Do this before the check for SMESH because it depends on vtk + # that may have its own OpenGL check but possibly fails and leaves + # OPENGL_gl_LIBRARY empty that results into linker errors + SetupOpenGL() + endif(BUILD_GUI) SetupSalomeSMESH() if (BUILD_FEM_NETGEN) find_package(NETGEN) @@ -64,7 +70,6 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) SetupFreetype() if(BUILD_GUI) - SetupOpenGL() SetupCoin3D() SetupSpaceball() SetupShibokenAndPyside() diff --git a/cMake/FreeCAD_Helpers/PrintFinalReport.cmake b/cMake/FreeCAD_Helpers/PrintFinalReport.cmake index 744fdd8ce9b1..96ea7de919c2 100644 --- a/cMake/FreeCAD_Helpers/PrintFinalReport.cmake +++ b/cMake/FreeCAD_Helpers/PrintFinalReport.cmake @@ -163,6 +163,7 @@ macro(PrintFinalReport) message(STATUS "Freetype: disabled") endif(FREECAD_USE_FREETYPE) + message(STATUS "OpenGL: ${OPENGL_gl_LIBRARY}") message(STATUS "OpenGLU: ${OPENGL_glu_LIBRARY} [${OPENGL_glu_LIBRARY}][${OPENGL_INCLUDE_DIR}]") message(STATUS "Coin3D: [${COIN3D_LIBRARIES}] [${COIN3D_INCLUDE_DIRS}]")