From 7ea583331d3f18eaad493d51029a5f046fe64465 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 7 Dec 2022 19:25:46 -0600 Subject: [PATCH] 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). --- cmake/configure/configure_50_gmsh.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/configure/configure_50_gmsh.cmake b/cmake/configure/configure_50_gmsh.cmake index 53f93ea485..afb6f19c99 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}) -- 2.39.5