]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add support for gmsh api in cmake.
authorLuca Heltai <luca.heltai@sissa.it>
Thu, 28 Jan 2021 11:31:48 +0000 (12:31 +0100)
committerLuca Heltai <luca.heltai@sissa.it>
Thu, 28 Jan 2021 11:31:48 +0000 (12:31 +0100)
cmake/configure/configure_gmsh.cmake
cmake/modules/FindGMSH.cmake
include/deal.II/base/config.h.in

index 9418a815bc484f58865414d5e3a9b6906cdbd686..75e7404d909e9705890296b283c16777d931b8d5 100644 (file)
@@ -18,3 +18,4 @@
 #
 
 CONFIGURE_FEATURE(GMSH)
+SET(DEAL_II_GMSH_WITH_API ${GMSH_WITH_API})
index b346ca374c8fcec4192b44645dcec4355914f290..3a715dc97dfc0beeb34e0a0869d11cb0c4e57ff1 100644 (file)
 # This module exports
 #
 #   GMSH_EXECUTABLE
+#   GMSH_LIBRARY
+#   GMSH_INCLUDE_DIR
+#   GMSH_WITH_API
 #
 
 SET(GMSH_DIR "" CACHE PATH "An optional hint to a Gmsh installation containing the gmsh executable")
 SET_IF_EMPTY(GMSH_DIR "$ENV{GMSH_DIR}")
 
+SET(GMSH_LIBRARY_DIR "" CACHE PATH "An optional hint to a Gmsh SDK installation")
+SET_IF_EMPTY(GMSH_LIBRARY_DIR "$ENV{GMSH_DIR}")
+
 DEAL_II_FIND_PROGRAM(GMSH_EXE gmsh${CMAKE_EXECUTABLE_SUFFIX}
   HINTS ${GMSH_DIR}
   PATH_SUFFIXES bin
   )
 
+DEAL_II_FIND_LIBRARY(GMSH_LIBRARY
+  NAMES gmsh
+  HINTS ${GMSH_LIBRARY_DIR}
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+  )
+
+DEAL_II_FIND_PATH(GMSH_INCLUDE_DIR gmsh.h
+  HINTS ${GMSH_LIBRARY_DIR}
+  PATH_SUFFIXES include
+  )
+
+IF(GMSH_LIBRARY MATCHES "-NOTFOUND" OR 
+   GMSH_INCLUDE_DIR MATCHES "-NOTFOUND")
+  SET(GMSH_WITH_API FALSE)
+ELSE()
+  SET(GMSH_WITH_API TRUE)
+ENDIF()
+
 DEAL_II_PACKAGE_HANDLE(GMSH
-  EXECUTABLE REQUIRED GMSH_EXE
+  EXECUTABLE 
+    REQUIRED GMSH_EXE
+  LIBRARIES
+    OPTIONAL GMSH_LIBRARY
+  INCLUDE_DIRS 
+    OPTIONAL GMSH_INCLUDE_DIR
+  USER_INCLUDE_DIRS 
+    OPTIONAL GMSH_INCLUDE_DIR
   CLEAR
-    GMSH_EXE
+    GMSH_EXE 
+    GMSH_LIBRARY 
+    GMSH_INCLUDE_DIR 
+    GMSH_WITH_API
   )
index 27e0d959e13ab4b2ab3e5bbf35e024e2524071e8..fba8f32f6909f4a5fe91c7d40ca99bfb90bbaed8 100644 (file)
 /* cmake/modules/FindARPACK.cmake */
 #cmakedefine DEAL_II_ARPACK_WITH_PARPACK
 
+/* cmake/modules/FindGMSH.cmake */
+#cmakedefine DEAL_II_GMSH_WITH_API
+
 /* cmake/modules/FindPETSC.cmake */
 #cmakedefine DEAL_II_PETSC_WITH_COMPLEX
 #cmakedefine DEAL_II_PETSC_WITH_HYPRE

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.