From: Matthias Maier Date: Thu, 8 Dec 2022 01:25:46 +0000 (-0600) Subject: CMake: Bugfix: only export DEAL_II_GMSH_WITH_API if gmsh is configured X-Git-Tag: v9.4.2~4^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df39deedacde256a07c15434c85011a220233fd7;p=dealii.git CMake: Bugfix: only export DEAL_II_GMSH_WITH_API if gmsh is configured If the gmsh library is installed but the gmsh executable is missing we currently disable gmsh support. This implies that we will not link against the gmsh library. Unfortunately, on first configure pass the variable `GMSH_WITH_API` is still populated with a `TRUE` value and the `DEAL_II_GMSH_WITH_API` variable gets set by accident and final linkage fails. This issue is hard to spot because a second invocation of cmake will cure the configure mistake (and the debian/ubuntu packages do not run any autodetection). --- diff --git a/cmake/configure/configure_50_gmsh.cmake b/cmake/configure/configure_50_gmsh.cmake index e4764802a3..310384c806 100644 --- a/cmake/configure/configure_50_gmsh.cmake +++ b/cmake/configure/configure_50_gmsh.cmake @@ -17,5 +17,8 @@ # Configuration for the gmsh executable: # +MACRO(feature_gmsh_configure_external) + SET(DEAL_II_GMSH_WITH_API ${GMSH_WITH_API}) +ENDMACRO() + CONFIGURE_FEATURE(GMSH) -SET(DEAL_II_GMSH_WITH_API ${GMSH_WITH_API})