PROJECT(deal.II)
+
SET(VERSION "8.0.pre")
+
+
+
+#
+# General configuration for cmake:
+#
+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-#TODO:
-SET(CMAKE_CXX_FLAGS "-std=c++0x -D_REENTRANT -fPIC -O2 -march=native") #TODO: c++0x Features umschalten
SET(CMAKE_INCLUDE_CURRENT_DIR true)
+SET(CMAKE_MODULE_PATH
+ ${CMAKE_MODULE_PATH}
+ "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/"
+ "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/"
+ "${CMAKE_SOURCE_DIR}/contrib/cmake/tests/"
+ )
+
#
# General configuration options:
#
+#TODO:
+SET(CMAKE_CXX_FLAGS "-std=c++0x -Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") #TODO: c++0x Features umschalten
+
OPTION(DEAL_II_WITH_THREADS
"Build deal.II with support for threads. This pulls in libtbb as a dependency."
ON)
"Build deal.II with support for Metis."
OFF)
-# TODO: The rest ;-)
-
-
OPTION(DEAL_II_ALLOW_CONTRIB
"Allow the use of contrib libraries bundled with the source tarball.
Note: If set to off DEAL_II_FORCE_CONTRIB* will still pull in bundled
OFF)
+
#
# Now, configure and prepare a lot of things:
#
-SET(CMAKE_MODULE_PATH
- ${CMAKE_MODULE_PATH}
- "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/"
- )
-
-#
# used as a dummy target for all the stuff that has to be done before the
# library can be compiled:
-#
ADD_CUSTOM_TARGET(deal_ii_target_dependencies)
-# TODO: Version Mumbo Jumbo
+
+#
+# Platform checks:
+#
+
+INCLUDE(check_cxx_features)
+
+
+
+#
+# Feature configuration:
+#
INCLUDE(prepare_boost)
INCLUDE(prepare_umfpack)
ENDIF()
-# TODO: The rest...
-
#
ADD_SUBDIRECTORY(common/expand_instantiations)
+
#
# Compile the library:
#
])
-dnl -------------------------------------------------------------
-dnl gcc2.95 doesn't have the std::iterator class, but the standard
-dnl requires it, so check whether we have to work around it
-dnl
-dnl Usage: DEAL_II_HAVE_STD_ITERATOR
-dnl
-dnl -------------------------------------------------------------
-AC_DEFUN(DEAL_II_HAVE_STD_ITERATOR, dnl
-[
- AC_MSG_CHECKING(for std::iterator class)
- AC_LANG(C++)
- CXXFLAGS="$CXXFLAGSG"
- AC_TRY_COMPILE(
- [
-#include <iterator>
- class MyIterator : public std::iterator<std::bidirectional_iterator_tag,int>
- {};
- ],
- [],
- [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_STD_ITERATOR_CLASS, 1,
- [Define if the compiler's library in use provides a
- std::iterator class (early gcc versions did not)])
- ],
- [
- AC_MSG_RESULT(no)
- ])
-])
-
-
-
-
-dnl -------------------------------------------------------------
-dnl Up to early gcc2.95 releases, the i/ostringstream classes were not
-dnl available. check their availability, or whether we have to fall back
-dnl to the old strstream classes.
-dnl
-dnl Usage: DEAL_II_HAVE_STD_STRINGSTREAM
-dnl
-dnl -------------------------------------------------------------
-AC_DEFUN(DEAL_II_HAVE_STD_STRINGSTREAM, dnl
-[
- AC_MSG_CHECKING(for std::i/ostringstream classes)
- AC_LANG(C++)
- CXXFLAGS="$CXXFLAGSG"
- AC_TRY_COMPILE(
- [
-#include <sstream>
- ],
- [
- std::istringstream i;
- std::ostringstream o;
- ],
- [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_STD_STRINGSTREAM, 1,
- [Define if the compiler's library in use provides
- std::i/ostringstream classes (early gcc versions did not)])
- ],
- [
- AC_MSG_RESULT(no)
- ])
-])
${Boost_THREAD_LIBRARY_DEBUG} ${Boost_SERIALIZATION_LIBRARY_DEBUG}
)
+ # TODO: Renaming!
SET(DEAL_II_USE_EXTERNAL_BOOST TRUE)
ENDIF()
ENDIF()
${TBB_DEBUG_LIBRARY}
)
+# TODO: Renaming!
SET(DEAL_II_USE_MT TRUE)
SET(DEAL_II_USE_MT_POSIX TRUE)
--- /dev/null
+INCLUDE(CheckCXXSourceCompiles)
+
+#
+# Check for various CXX Features.
+#
+
+
+
+
+#
+# gcc2.95 doesn't have the std::iterator class, but the standard
+# requires it, so check whether we have to work around it
+#
+CHECK_CXX_SOURCE_COMPILES(
+ "
+ #include <iterator>
+ class MyIterator : public std::iterator<std::bidirectional_iterator_tag,int>{};
+ int main(){return 0;}
+ "
+ HAVE_STD_ITERATOR_CLASS)
+
+
+#
+# Up to early gcc2.95 releases, the i/ostringstream classes were not
+# available. check their availability, or whether we have to fall back
+# to the old strstream classes.
+#
+CHECK_CXX_SOURCE_COMPILES(
+ "
+ #include <sstream>
+ std::istringstream i;
+ std::ostringstream o;
+ int main(){return 0;}
+ "
+ HAVE_STD_STRINGSTREAM)
-/* Configured in prepare_boost.cmake: */
+
+/*
+ * Configured in check_cxx_features:
+ */
+
+
+/* Defined if the compiler's library in use provides a std::iterator class
+ (early gcc versions did not) */
+#cmakedefine HAVE_STD_ITERATOR_CLASS 1
+
+/* Defined if the compiler's library in use provides std::i/ostringstream
+ classes (early gcc versions did not) */
+#cmakedefine HAVE_STD_STRINGSTREAM 1
+
+
+
+
+
+/*
+ * Configured in prepare_boost.cmake:
+ */
+
/* Defined if deal.II is configured with an external Boost library */
#cmakedefine DEAL_II_USE_EXTERNAL_BOOST
-/* Configured in prepare_threads.cmake: */
+
+/*
+ * Configured in prepare_threads.cmake:
+ */
+
/* Flag indicating whether the library shall be compiled for multithreaded
* applications. If so, then it is set to one, otherwise to zero.
-/* Configured in prepare_umfpack.cmake: */
+
+/*
+ * Configured in prepare_umfpack.cmake:
+ */
+
/* Defined if deal.II was configured with UMFPACK support */
#cmakedefine HAVE_LIBUMFPACK
/* Define if the compiler provides an <iosfwd> header file */
#cmakedefine HAVE_STD_IOSFWD_HEADER
-/* Define if the compiler's library in use provides a std::iterator class
- (early gcc versions did not) */
-#cmakedefine HAVE_STD_ITERATOR_CLASS
-
/* Define if the compiler's library in use provides std::numeric_limits
classes in the appropriate header file */
#cmakedefine HAVE_STD_NUMERIC_LIMITS
/* Define if the compiler provides an <ostream> header file */
#cmakedefine HAVE_STD_OSTREAM_HEADER
-/* Define if the compiler's library in use provides std::i/ostringstream
- classes (early gcc versions did not) */
-#cmakedefine HAVE_STD_STRINGSTREAM
-
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H