From: maier Date: Tue, 11 Sep 2012 14:22:27 +0000 (+0000) Subject: Add Support for contrib functionparser, TODO: external X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b327484a529cf573d60be8089fc951518c240b9c;p=dealii-svn.git Add Support for contrib functionparser, TODO: external git-svn-id: https://svn.dealii.org/branches/branch_cmake@26284 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 9d6d998e96..899fa2ebef 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -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 diff --git a/deal.II/contrib/cmake/configure/configure_functionparser.cmake b/deal.II/contrib/cmake/configure/configure_functionparser.cmake index 8a6eb5dc17..2721f8447d 100644 --- a/deal.II/contrib/cmake/configure/configure_functionparser.cmake +++ b/deal.II/contrib/cmake/configure/configure_functionparser.cmake @@ -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 + $ + ) + +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 index 0000000000..6e1db2c67d --- /dev/null +++ b/deal.II/contrib/functionparser/CMakeLists.txt @@ -0,0 +1 @@ +ADD_LIBRARY(obj_functionparser OBJECT "fparser.cc") diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index a47133d745..7ad180e13c 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -63,6 +63,16 @@ +/* + * Configured in configure_functionparser.cmake: + */ + +/* Defined to 1 if you have the `functionparser' library */ +#cmakedefine HAVE_FUNCTIONPARSER 1 + + + + /* * Configured in configure_mpi.cmake: */ diff --git a/deal.II/include/deal.II/base/config.h.in.old b/deal.II/include/deal.II/base/config.h.in.old index 226d580570..8abe716edf 100644 --- a/deal.II/include/deal.II/base/config.h.in.old +++ b/deal.II/include/deal.II/base/config.h.in.old @@ -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 diff --git a/deal.II/source/base/function_parser.cc b/deal.II/source/base/function_parser.cc index 694936ad40..e439366ae6 100644 --- a/deal.II/source/base/function_parser.cc +++ b/deal.II/source/base/function_parser.cc @@ -15,7 +15,7 @@ #include #include -#ifndef DEAL_II_DISABLE_PARSER +#ifdef HAVE_FUNCTIONPARSER # include #else @@ -50,7 +50,7 @@ FunctionParser::~FunctionParser() } -#ifndef DEAL_II_DISABLE_PARSER +#ifdef HAVE_FUNCTIONPARSER template void FunctionParser::initialize (const std::string &variables, const std::vector &expressions,