]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Add support for the muparser library
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 13 Dec 2013 23:28:32 +0000 (23:28 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 13 Dec 2013 23:28:32 +0000 (23:28 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_muparser@31997 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/config/CMakeLists.txt
deal.II/cmake/configure/configure_muparser.cmake [new file with mode: 0644]
deal.II/cmake/modules/FindMUPARSER.cmake [new file with mode: 0644]
deal.II/cmake/scripts/run_testsuite.cmake
deal.II/doc/users/Config.sample
deal.II/doc/users/cmake.html
deal.II/doc/users/cmakelists.html
deal.II/include/deal.II/base/config.h.in

index e499bafbee8040488bd14876e0194efcaa958fec..f78fc4e76831cc15039a5bdd30162553bdf2eec3 100644 (file)
@@ -329,18 +329,18 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
   COND_SET_TO_YES(DEAL_II_WITH_FUNCTIONPARSER MAKEFILE_enableparser)
   COND_SET_TO_YES(BUILD_SHARED_LIBS MAKEFILE_enableshared)
 
-  COND_SET_TO_YES(DEAL_II_WITH_PETSC MAKEFILE_PETSC)
-  COND_SET_TO_YES(DEAL_II_WITH_SLEPC MAKEFILE_SLEPC)
-  COND_SET_TO_YES(DEAL_II_WITH_TRILINOS MAKEFILE_TRILINOS)
-  COND_SET_TO_YES(DEAL_II_WITH_HDF5 MAKEFILE_HDF5)
+  COND_SET_TO_YES(DEAL_II_WITH_ARPACK MAKEFILE_ARPACK)
   COND_SET_TO_YES(DEAL_II_WITH_BLAS MAKEFILE_BLAS)
-  COND_SET_TO_YES(DEAL_II_WITH_MUMPS MAKEFILE_MUMPS)
+  COND_SET_TO_YES(DEAL_II_WITH_HDF5 MAKEFILE_HDF5)
   COND_SET_TO_YES(DEAL_II_WITH_LAPACK MAKEFILE_LAPACK)
-  COND_SET_TO_YES(DEAL_II_WITH_ARPACK MAKEFILE_ARPACK)
   COND_SET_TO_YES(DEAL_II_WITH_METIS MAKEFILE_METIS)
-  COND_SET_TO_YES(DEAL_II_WITH_UMFPACK MAKEFILE_UMFPACK)
-  COND_SET_TO_YES(DEAL_II_WITH_P4EST MAKEFILE_P4EST)
   COND_SET_TO_YES(DEAL_II_WITH_MPI MAKEFILE_MPI)
+  COND_SET_TO_YES(DEAL_II_WITH_MUMPS MAKEFILE_MUMPS)
+  COND_SET_TO_YES(DEAL_II_WITH_P4EST MAKEFILE_P4EST)
+  COND_SET_TO_YES(DEAL_II_WITH_PETSC MAKEFILE_PETSC)
+  COND_SET_TO_YES(DEAL_II_WITH_SLEPC MAKEFILE_SLEPC)
+  COND_SET_TO_YES(DEAL_II_WITH_TRILINOS MAKEFILE_TRILINOS)
+  COND_SET_TO_YES(DEAL_II_WITH_UMFPACK MAKEFILE_UMFPACK)
 
   #
   # For binary dir:
diff --git a/deal.II/cmake/configure/configure_muparser.cmake b/deal.II/cmake/configure/configure_muparser.cmake
new file mode 100644 (file)
index 0000000..93dcbc7
--- /dev/null
@@ -0,0 +1,21 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# Configuration for the MUPARSER library:
+#
+
+CONFIGURE_FEATURE(MUPARSER)
diff --git a/deal.II/cmake/modules/FindMUPARSER.cmake b/deal.II/cmake/modules/FindMUPARSER.cmake
new file mode 100644 (file)
index 0000000..cab3659
--- /dev/null
@@ -0,0 +1,75 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# Try to find the MUPARSER library
+#
+# This module exports
+#
+#   MUPARSER_LIBRARIES
+#   MUPARSER_INCLUDE_DIRS
+#   MUPARSER_VERSION
+#   MUPARSER_VERSION_MAJOR
+#   MUPARSER_VERSION_MINOR
+#   MUPARSER_VERSION_SUBMINOR
+#
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+SET_IF_EMPTY(MUPARSER_DIR "$ENV{MUPARSER_DIR}")
+
+FIND_LIBRARY(MUPARSER_LIBRARY
+  NAMES muparser
+  HINTS ${MUPARSER_DIR}
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+  )
+
+FIND_PATH(MUPARSER_INCLUDE_DIR muParserDef.h
+  HINTS ${MUPARSER_DIR}
+  PATH_SUFFIXES include
+  )
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUPARSER DEFAULT_MSG
+  MUPARSER_LIBRARY
+  MUPARSER_INCLUDE_DIR
+  )
+
+IF(MUPARSER_FOUND)
+  SET(MUPARSER_LIBRARIES ${MUPARSER_LIBRARY})
+  SET(MUPARSER_INCLUDE_DIRS ${MUPARSER_INCLUDE_DIR})
+
+  FILE(STRINGS "${MUPARSER_INCLUDE_DIR}/muParserDef.h" MUPARSER_VERSION_STRING
+    REGEX "#define MUP_VERSION _T"
+    )
+  STRING(REGEX REPLACE ".*\"([0-9]+)\\.[0-9]+\\..*" "\\1"
+    MUPARSER_VERSION_MAJOR "${MUPARSER_VERSION_STRING}"
+    )
+  STRING(REGEX REPLACE ".*\\.([0-9]+)\\..*" "\\1"
+    MUPARSER_VERSION_MINOR "${MUPARSER_VERSION_STRING}"
+    )
+  STRING(REGEX REPLACE ".*\\.[0-9]+\\.([0-9]+)\".*" "\\1"
+    MUPARSER_VERSION_SUBMINOR "${MUPARSER_VERSION_STRING}"
+    )
+  SET(MUPARSER_VERSION
+    "${MUPARSER_VERSION_MAJOR}.${MUPARSER_VERSION_MINOR}.${MUPARSER_VERSION_SUBMINOR}"
+    )
+
+  MARK_AS_ADVANCED(MUPARSER_DIR)
+ELSE()
+  SET(MUPARSER_DIR "" CACHE PATH
+    "An optional hint to a MUPARSER installation"
+    )
+ENDIF()
index ffa6253e5bfb01dbca250b12405fe05d5973d0f0..9440c6479ccb87c3cf6c4ab5806eaf70b5627474 100644 (file)
@@ -275,7 +275,7 @@ FOREACH(_var ${_variables})
       _var MATCHES "^(COMPAT_FILES|DOCUMENTATION|EXAMPLES|MESH_CONVERTER|PARAMETER_GUI)" OR
       _var MATCHES "^(ARPACK|BOOST|FUNCTIONPARSER|HDF5|METIS|MPI|MUMPS)_" OR
       _var MATCHES "^(NETCDF|P4EST|PETSC|SLEPC|THREADS|TBB|TRILINOS)_" OR
-      _var MATCHES "^(UMFPACK|ZLIB|LAPACK)_" OR
+      _var MATCHES "^(UMFPACK|ZLIB|LAPACK|MUPARSER)_" OR
       _var MATCHES "^(CMAKE|DEAL_II)_(C|CXX|Fortran|BUILD)_(COMPILER|FLAGS)" OR
       _var MATCHES "^CMAKE_BUILD_TYPE$" OR
       _var MATCHES "MAKEOPTS" OR
index 26faa6c15b3d394ef4058ec45dfbd505e97d6728..b37132c37046809ef14838d0b721c30c272092ec 100644 (file)
 #
 
 
+#
+# muPaser:
+#
+# SET(DEAL_II_WITH_MUPARSER ON CACHE BOOL
+#   "Build deal.II with support for muparser"
+#
+# Automatic detection:
+#
+# Specify a hint with CMAKE_PREFIX_PATH or by setting
+# SET(MUPARSER_DIR "/.../..." CACHE PATH "")
+#
+# Manual setup:
+#
+# SET(MUPARSER_FOUND TRUE CACHE BOOL "")
+# SET(MUPARSER_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
+# SET(MUPARSER_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
+#
+
+
 #
 # Netcdf:
 #
index 1f2d695a10e897b48399d8c0c2b84caefa5a7fdf..7d2afcbaa91dbca86474b228dcb1d12438612ba4 100644 (file)
@@ -450,6 +450,7 @@ DEAL_II_WITH_FUNCTIONPARSER
 DEAL_II_WITH_LAPACK
 DEAL_II_WITH_METIS
 DEAL_II_WITH_MUMPS
+DEAL_II_WITH_MUPARSER
 DEAL_II_WITH_MPI
 DEAL_II_WITH_NETCDF
 DEAL_II_WITH_P4EST
@@ -596,6 +597,7 @@ HDF5_DIR,
 LAPACK_DIR (and BLAS_DIR),
 METIS_DIR,
 MUMPS_DIR (and SCALAPACK_DIR, BLACS_DIR),
+MUPARSER_DIR,
 P4EST_DIR (and SC_DIR),
 PETSC_DIR and PETSC_ARCH (forming ${PETSC_DIR}/${PETSC_ARCH}),
 SLEPC_DIR (forming ${SLEPC_DIR}/${PETSC_ARCH}),
index b1f13d8d7ad98c0210c67283640ae9c99a820703..8997a3e3c4dbc629c7aff16d087c25525b41d201 100644 (file)
@@ -795,6 +795,7 @@ DEAL_II_WITH_LAPACK
 DEAL_II_WITH_METIS
 DEAL_II_WITH_MPI
 DEAL_II_WITH_MUMPS
+DEAL_II_WITH_MUPARSER
 DEAL_II_WITH_NETCDF
 DEAL_II_WITH_P4EST
 DEAL_II_WITH_PETSC
index 571abc27f341370290ccc016032ab80fab3f2fd5..375549330f8db3654fe5e0b1ce1c2b743302d485 100644 (file)
 #endif
 
 
+/*************************************************
+ * Configured in configure_functionparser.cmake: *
+ *************************************************/
+
+#cmakedefine DEAL_II_WITH_MUPARSER
+
+
 /*****************************************
  * Configured in configure_netcdf.cmake: *
  *****************************************/

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.