]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add Support for contrib functionparser, TODO: external
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 11 Sep 2012 14:22:27 +0000 (14:22 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 11 Sep 2012 14:22:27 +0000 (14:22 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26284 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/CMakeLists.txt
deal.II/contrib/cmake/configure/configure_functionparser.cmake
deal.II/contrib/functionparser/CMakeLists.txt [new file with mode: 0644]
deal.II/include/deal.II/base/config.h.in
deal.II/include/deal.II/base/config.h.in.old
deal.II/source/base/function_parser.cc

index 9d6d998e96a8051150424df50f025504f6cb9907..899fa2ebef759af8849adeac97230e3a640b51ea 100644 (file)
@@ -60,7 +60,7 @@ OPTION(DEAL_II_WITH_METIS
   OFF)
 
 OPTION(DEAL_II_WITH_MPI
-  "Build deal.II with support for openmpi."
+  "Build deal.II with support for mpi."
   ON)
 
 OPTION(DEAL_II_WITH_NETCDF
index 8a6eb5dc17cfc13ef650fd3c93e0c2936bfebc38..2721f8447d4fa39f9a5fa429824154102c1b3bfb 100644 (file)
@@ -1 +1,31 @@
-# TODO :-]
+IF(DEAL_II_ALLOW_CONTRIB)
+  # TODO: Write a module to search for functionparser
+ELSE()
+  MESSAGE(FATAL_ERROR "FindFunctionparser.cmake not written, yet. :-[")
+ENDIF()
+
+IF(DEAL_II_FORCE_CONTRIB_FUNCTIONPARSER OR NOT Functionparser_FOUND)
+
+  INCLUDE_DIRECTORIES(
+    ${CMAKE_SOURCE_DIR}/contrib/functionparser/
+    )
+
+  ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/contrib/functionparser)
+
+  #
+  # Add functionparser directly to the object files of deal.II
+  #
+  LIST(APPEND deal_ii_additional_object_files
+    $<TARGET_OBJECTS:obj_functionparser>
+    )
+
+ELSE()
+
+  INCLUDE_DIRECTORIES(${Functionparser_INCLUDE_DIR})
+
+  LIST(APPEND deal_ii_external_libraries ${Functionparser_LIBRARY})
+  LIST(APPEND deal_ii_external_debug_libraries ${Functionparser_LIBRARY})
+
+ENDIF()
+
+SET(HAVE_FUNCTIONPARSER TRUE)
diff --git a/deal.II/contrib/functionparser/CMakeLists.txt b/deal.II/contrib/functionparser/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6e1db2c
--- /dev/null
@@ -0,0 +1 @@
+ADD_LIBRARY(obj_functionparser OBJECT "fparser.cc")
index a47133d7458c6a6b7f895e06cf812b735026b669..7ad180e13cfbe9f63f81254a25cfba43e0488870 100644 (file)
 
 
 
+/*
+ * Configured in configure_functionparser.cmake:
+ */
+
+/* Defined to 1 if you have the `functionparser' library */
+#cmakedefine HAVE_FUNCTIONPARSER 1
+
+
+
+
 /*
  * Configured in configure_mpi.cmake:
  */
index 226d5805704578acb78b0ea29f17f8e580ac8d8e..8abe716edfb0e4952df40006e89adb77bd73768a 100644 (file)
@@ -61,9 +61,6 @@
    member functions. */
 #cmakedefine DEAL_II_CONST_MEMBER_DEDUCTION_BUG
 
-/* disable the function parser in contrib */
-#cmakedefine DEAL_II_DISABLE_PARSER
-
 /* Defined if the compiler does not honor the explicit keyword on template
    constructors. */
 #cmakedefine DEAL_II_EXPLICIT_CONSTRUCTOR_BUG
index 694936ad40970ad02a22cba86319c3dbad4801ed..e439366ae6ca09d4ca0191cc7cbbdc8a95116817 100644 (file)
@@ -15,7 +15,7 @@
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/vector.h>
 
-#ifndef DEAL_II_DISABLE_PARSER
+#ifdef HAVE_FUNCTIONPARSER
 #  include <functionparser/fparser.h>
 #else
 
@@ -50,7 +50,7 @@ FunctionParser<dim>::~FunctionParser()
 }
 
 
-#ifndef DEAL_II_DISABLE_PARSER
+#ifdef HAVE_FUNCTIONPARSER
 template <int dim>
 void FunctionParser<dim>::initialize (const std::string                   &variables,
                       const std::vector<std::string>      &expressions,

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.