diff --git a/.gitignore b/.gitignore
index 31e7aaead52f22f67655b7f5d679841424c1a421..2da77d46752dc276994d5ee1a5c4b5c3a606a52d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,12 @@
 Makefile
 Makefile.in
-config.*
+config.guess  
+config.h.in   
+config.log  
+config.status
+config.h      
+config.lt   
+config.sub
 configure
 dependencies.m4
 aclocal.m4
@@ -19,3 +25,5 @@ dune-istl-?.?
 ltmain.sh
 am
 .libs
+config.guess
+config.h.in
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..2e438b32358aa34c71f0111edb88eb1cd4f724d2
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,24 @@
+# set up project
+project("dune-istl" C CXX)
+
+# general stuff
+cmake_minimum_required(VERSION 2.8.6)
+
+#find dune-common and set the module path
+find_package(dune-common)
+list(APPEND CMAKE_MODULE_PATH ${dune-common_MODULE_PATH}
+  "${PROJECT_SOURCE_DIR}/cmake/modules")
+
+#include the dune macros
+include(DuneMacros)
+
+# start a dune project with information from dune.module
+dune_project()
+
+add_subdirectory("cmake/modules")
+add_subdirectory("m4")
+add_subdirectory("dune")
+add_subdirectory("doc")
+
+# finalize the dune project, e.g. generating config.h etc.
+finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
diff --git a/Makefile.am b/Makefile.am
index 0ed9bf31c8ee48a19467dbb0bf59870787957b98..79c8ce59857318feb039b1059b8e3a5ca8629bbe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,13 +1,13 @@
 # $Id$
 
 # we need the module file to be able to build via dunecontrol
-EXTRA_DIST=dune.module
+EXTRA_DIST= CMakeLists.txt dune.module dune-istl-config.cmake.in  dune-istl-version.cmake.in
 
 # don't follow the full GNU-standard
 # we need automake 1.9 or newer
 AUTOMAKE_OPTIONS = foreign 1.9
 
-SUBDIRS = dune doc m4
+SUBDIRS = cmake dune doc m4
 
 # use configured compiler for "make distcheck"
 # doxygen is difficult to convince to build in a special directory...
@@ -15,3 +15,7 @@ DISTCHECK_CONFIGURE_FLAGS = --with-dune-common="$(DUNE_COMMON_ROOT)" CXX="$(CXX)
 
 include $(top_srcdir)/am/global-rules
 include $(top_srcdir)/am/top-rules
+
+# Distribute and install config.h.cmake
+configdir = $(datadir)/dune-istl
+dist_config_DATA = config.h.cmake
diff --git a/cmake/.gitignore b/cmake/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..3dda72986fc5af262451a760393b3a7065938c80
--- /dev/null
+++ b/cmake/.gitignore
@@ -0,0 +1,2 @@
+Makefile.in
+Makefile
diff --git a/cmake/Makefile.am b/cmake/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..4fce05b90e3795dc758e6da22eef5380a0eb8167
--- /dev/null
+++ b/cmake/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS= modules pkg
diff --git a/cmake/modules/.gitignore b/cmake/modules/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..3dda72986fc5af262451a760393b3a7065938c80
--- /dev/null
+++ b/cmake/modules/.gitignore
@@ -0,0 +1,2 @@
+Makefile.in
+Makefile
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e2a063cd6fe3978391a1d4234bb3116add8ae71b
--- /dev/null
+++ b/cmake/modules/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(modules DuneIstlMacros.cmake
+  FindSuperLU.cmake)
+
+install(FILES ${modules} DESTINATION
+  ${DUNE_INSTALL_MODULEDIR})
diff --git a/cmake/modules/DuneIstlMacros.cmake b/cmake/modules/DuneIstlMacros.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..249200ad2ac95fea38b64b118d877fe96ab30f67
--- /dev/null
+++ b/cmake/modules/DuneIstlMacros.cmake
@@ -0,0 +1,5 @@
+include(FindBoostFusion)
+include(FindParMETIS)
+message("PARMETIS_FOUND=${PARMETIS_FOUND}")
+message("ParMETIS_FOUND=${ParMETIS_FOUND}")
+include(FindSuperLU)
diff --git a/cmake/modules/FindSuperLU.cmake b/cmake/modules/FindSuperLU.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..7f539f9c29d2637629813b505e1d1870df038a4b
--- /dev/null
+++ b/cmake/modules/FindSuperLU.cmake
@@ -0,0 +1,146 @@
+#
+# Module that checks whether SuperLU is available and usable.
+# SuperLU must be a version released after the year 2005.
+#
+# Variables used by this module which you may want to set:
+# SUPERLU_PREFIX          Path list to search for SuperLU
+#
+# Sets the follwing variable:
+#
+# SUPERLU_FOUND           True if SuperLU available and usable.
+# SUPERLU_MIN_VERSION_4_3 True if SuperLU version >= 4.3.
+# SUPERLU_WITH_VERSION    Human readable string containing version information.
+# SUPERLU_INCLUDE_DIRS    Path to the SuperLU include dirs.
+# SUPERLU_LIBRARIES       Name to the SuperLU library.
+#
+
+# adds SuperLU flags to the targets
+function(add_dune_superlu_flags _targets)
+  if(SUPERLU_FOUND)
+    foreach(_target ${_targets})
+      target_link_libraries(${_target} ${SUPERLU_DUNE_LIBRARIES})
+      get_target_property(_props ${_target} COMPILE_FLAGS)
+      string(REPLACE "_props-NOTFOUND" "" _props "${_props}")
+      set_target_properties(${_target} PROPERTIES COMPILE_FLAGS
+        "${_props} ${SUPERLU_DUNE_COMPILE_FLAGS} -DENABLE_SUPERLU=1")
+    endforeach(_target ${_targets})
+  endif(SUPERLU_FOUND)
+endfunction(add_dune_superlu_flags)
+
+# look for BLAS
+find_package(BLAS QUIET REQUIRED)
+if(NOT BLAS_FOUND)
+  message(WARNING "SuperLU requires BLAS which was not found, skipping the test.")
+  return()
+endif(NOT BLAS_FOUND)
+
+# look for header files, only at positions given by the user
+find_path(SUPERLU_INCLUDE_DIR
+  NAMES supermatrix.h
+  PATHS ${SUPERLU_PREFIX}
+  PATH_SUFFIXES "superlu" "include/superlu" "include" "SRC"
+  NO_DEFAULT_PATH
+)
+
+# look for header files, including default paths
+find_path(SUPERLU_INCLUDE_DIR
+  NAMES supermatrix.h
+  PATH_SUFFIXES "superlu" "include/superlu" "include" "SRC"
+)
+
+# look for library, only at positions given by the user
+find_library(SUPERLU_LIBRARY
+  NAMES "superlu_4.3" "superlu_4.2" "superlu_4.1" "superlu_4.0" "superlu_3.1" "superlu_3.0" "superlu"
+  PATHS ${SUPERLU_PREFIX}
+  PATH_SUFFIXES "lib" "lib32" "lib64"
+  NO_DEFAULT_PATH
+)
+
+# look for library files, including default paths
+find_library(SUPERLU_LIBRARY
+  NAMES "superlu_4.3" "superlu_4.2" "superlu_4.1" "superlu_4.0" "superlu_3.1" "superlu_3.0" "superlu"
+  PATH_SUFFIXES "lib" "lib32" "lib64"
+)
+
+# check version specific macros
+include(CheckCSourceCompiles)
+include(CMakePushCheckState)
+cmake_push_check_state()
+
+# we need if clauses here because variable is set variable-NOTFOUND
+# if the searches above were not successful
+# Without them CMake print errors like:
+# "CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
+# Please set them or make sure they are set and tested correctly in the CMake files:"
+#
+if(SUPERLU_INCLUDE_DIR)
+  set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${SUPERLU_INCLUDE_DIR})
+endif(SUPERLU_INCLUDE_DIR)
+if(SUPERLU_LIBRARY)
+  set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${SUPERLU_LIBRARY})
+endif(SUPERLU_LIBRARY)
+if(BLAS_LIBRARIES)
+  set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${BLAS_LIBRARIES})
+endif(BLAS_LIBRARIES)
+# check whether "mem_usage_t.expansions" was found in "slu_ddefs.h"
+CHECK_C_SOURCE_COMPILES("
+#include <slu_ddefs.h>
+int main(void)
+{
+  mem_usage_t mem;
+  return mem.expansions;
+}"
+HAVE_MEM_USAGE_T_EXPANSIONS)
+
+# check whether version is at least 4.3
+CHECK_C_SOURCE_COMPILES("
+#include <slu_ddefs.h>
+int main(void)
+{
+  return SLU_DOUBLE;
+}"
+SUPERLU_MIN_VERSION_4_3)
+cmake_pop_check_state()
+
+if(SUPERLU_MIN_VERSION_4_3)
+  set(SUPERLU_WITH_VERSION "SuperLU >= 4.3" CACHE STRING
+    "Human readable string containing SuperLU version information.")
+else()
+  set(SUPERLU_WITH_VERSION "SuperLU <= 4.2, post 2005" CACHE STRING
+    "Human readable string containing SuperLU version information.")
+endif(SUPERLU_MIN_VERSION_4_3)
+
+# behave like a CMake module is supposed to behave
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+  "SuperLU"
+  DEFAULT_MSG
+  SUPERLU_INCLUDE_DIR
+  SUPERLU_LIBRARY
+)
+
+mark_as_advanced(SUPERLU_INCLUDE_DIR SUPERLU_LIBRARY)
+
+# if both headers and library are found, store results
+if(SUPERLU_FOUND)
+  set(SUPERLU_INCLUDE_DIRS ${SUPERLU_INCLUDE_DIR})
+  set(SUPERLU_LIBRARIES    ${SUPERLU_LIBRARY})
+  # log result
+  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    "Determing location of ${SUPERLU_WITH_VERSION} succeded:\n"
+    "Include directory: ${SUPERLU_INCLUDE_DIRS}\n"
+    "Library directory: ${SUPERLU_LIBRARIES}\n\n")
+  set(SUPERLU_DUNE_COMPILE_FLAGS "-I${SUPERLU_INCLUDE_DIRS}"
+    CACHE STRING "Compile flags used by DUNE when compiling SuperLU programs")
+  set(SUPERLU_DUNE_LIBRARIES ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}
+    CACHE STRING "Libraries used by DUNE when linking SuperLU programs")
+else(SUPERLU_FOUND)
+  # log errornous result
+  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    "Determing location of SuperLU failed:\n"
+    "Include directory: ${SUPERLU_INCLUDE_DIRS}\n"
+    "Library directory: ${SUPERLU_LIBRARIES}\n\n")
+endif(SUPERLU_FOUND)
+
+# set HAVE_SUPERLU for config.h
+set(HAVE_SUPERLU SUPERLU_FOUND)
diff --git a/cmake/modules/Makefile.am b/cmake/modules/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..1c8e622ffcaec8cc316d1c9a3f4cd64ec79da259
--- /dev/null
+++ b/cmake/modules/Makefile.am
@@ -0,0 +1,9 @@
+MODULES = DuneIstlMacros.cmake \
+ FindSuperLU.cmake
+
+modulesdir= $(datadir)/cmake/modules
+dist_modules_DATA = ${MODULES}
+
+include $(top_srcdir)/am/global-rules
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/cmake/pkg/.gitignore b/cmake/pkg/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..3dda72986fc5af262451a760393b3a7065938c80
--- /dev/null
+++ b/cmake/pkg/.gitignore
@@ -0,0 +1,2 @@
+Makefile.in
+Makefile
diff --git a/cmake/pkg/Makefile.am b/cmake/pkg/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..94a3abc556da99fb4f43959d78b7b4e9944dd5af
--- /dev/null
+++ b/cmake/pkg/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = dune-istl-config.cmake.in
diff --git a/cmake/pkg/dune-istl-config.cmake.in b/cmake/pkg/dune-istl-config.cmake.in
new file mode 100644
index 0000000000000000000000000000000000000000..1805f3e16a2beaf685a79592128c5105b5de0b28
--- /dev/null
+++ b/cmake/pkg/dune-istl-config.cmake.in
@@ -0,0 +1,20 @@
+if(NOT @DUNE_MOD_NAME@_FOUND)
+#compute installation prefix relative to this file
+get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_prefix "${_dir}/../../.." ABSOLUTE)
+
+#import the target
+#include("${_prefix}/lib/cmake/@DUNE_MOD_NAME@-targets.cmake")
+
+#report other information
+set(@DUNE_MOD_NAME@_PREFIX "${_prefix}")
+set(@DUNE_MOD_NAME@_INCLUDE_DIRS "${_prefix}/include")
+set(@DUNE_MOD_NAME@_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
+set(@DUNE_MOD_NAME@_DEPENDS "@DUNE_DEPENDS@")
+set(@DUNE_MOD_NAME@_SUGGESTS "@DUNE_SUGGESTS@")
+set(@DUNE_MOD_NAME@_MODULE_PATH "@DUNE_INSTALL_MODULEDIR@")
+endif(NOT @DUNE_MOD_NAME@_FOUND)
\ No newline at end of file
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..d7894dc2ac100a662a2c5d4d1a6c1ddb3e62edfa
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,68 @@
+/* begin dune-istl
+   put the definitions for config.h specific to
+   your project here. Everything above will be
+   overwritten
+*/
+
+/* begin private */
+/* Name of package */
+#define PACKAGE "@DUNE_MOD_NAME"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "@DUNE_MAINTAINER@"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "@DUNE_MOD_NAME@"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "@DUNE_MOD_NAME@ @DUNE_MOD_VERSION@"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "@DUNE_MOD_NAME@"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "@DUNE_MOD_URL@"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "@DUNE_MOD_VERSION@"
+
+/* end private */
+
+/* define if the Boost::Fusion headers are available */
+#cmakedefine HAVE_BOOST_FUSION
+
+/* Define to ENABLE_BOOST if the Boost library is available */
+#cmakedefine HAVE_BOOST ENABLE_BOOST
+
+/* Define to ENABLE_PARMETIS if you have the Parmetis library.
+   This is only true if MPI was found
+   by configure _and_ if the application uses the PARMETIS_CPPFLAGS */
+#cmakedefine HAVE_PARMETIS ENABLE_PARMETIS
+
+/* Define to ENABLE_SUPERLU if the SuperLU library is available */
+#cmakedefine HAVE_SUPERLU ENABLE_SUPERLU
+
+/* define to 1 because older versions of SuperLU are no longer supported*/
+#define SUPERLU_POST_2005_VERSION 1
+
+/* Define to 1 if 'expansions' is a member of 'mem_usage_t'. */
+#cmakedefine HAVE_MEM_USAGE_T_EXPANSIONS @HAVE_MEM_USAGE_T_EXPANSIONS@
+
+/* define to 1 if SuperLU header slu_ddefs.h contains SLU_DOUBLE */
+#cmakedefine SUPERLU_MIN_VERSION_4_3 @SUPERLU_MIN_VERSION_4_3@
+
+/* Define to the version of dune-istl */
+#define DUNE_ISTL_VERSION "${DUNE_ISTL_VERSION}"
+
+/* Define to the major version of dune-istl */
+#define DUNE_ISTL_VERSION_MAJOR ${DUNE_ISTL_VERSION_MAJOR}
+
+/* Define to the minor version of dune-istl */
+#define DUNE_ISTL_VERSION_MINOR ${DUNE_ISTL_VERSION_MINOR}
+
+/* Define to the revision of dune-istl */
+#define DUNE_ISTL_VERSION_REVISION ${DUNE_ISTL_VERSION_REVISION}
+
+/* end dune-istl
+   Everything below here will be overwritten
+*/
diff --git a/configure.ac b/configure.ac
index 33cf303274b807886e63cb40bef92ad2dd4e9d58..80cdc50b695ce51b9227cd3922df2d91be7e44ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,9 @@ AC_SUBST([AM_LDFLAGS], '$(DUNE_LDFLAGS) $(DUNE_LIBS)')
 
 # write output
 AC_CONFIG_FILES([Makefile
+    cmake/Makefile
+    cmake/modules/Makefile
+    cmake/pkg/Makefile
     doc/doxygen/Makefile
     doc/doxygen/Doxyfile
     doc/Makefile
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1b294f48412be9c7612e7a22e3968d5526a92bac
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_subdirectory("doxygen")
+dune_add_latex_document(istl.tex FATHER_TARGET doc
+  BIB_FILES istl.bib  DEFAULT_SAFEPDF IMAGES blockstructure.eps)
+create_doc_install(istl.pdf
+  ${CMAKE_INSTALL_DOCDIR} istl_safepdf)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 79f89c17fa06a5e912f403d96a422bde692e15b8..07dc256b2bd52ba6e240b10f5c50211c676ec4cf 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -6,7 +6,7 @@ TEXSOURCES = istl.tex istl.bib
 EPSFILES = blockstructure.eps
 if BUILD_DOCS
   DOCFILES = istl.pdf
-  EXTRA_DIST = $(DOCFILES)
+  EXTRA_DIST = CMakeLists.txt $(DOCFILES)
   EXTRAINSTALL = $(DOCFILES)
 endif
 
diff --git a/doc/doxygen/CMakeLists.txt b/doc/doxygen/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0f65f1ba5d597b9463f51d0cb5c045e77cd8daab
--- /dev/null
+++ b/doc/doxygen/CMakeLists.txt
@@ -0,0 +1,4 @@
+# shortcut for creating the Doxyfile.in and Doxyfile
+add_doxygen_target()
+
+
diff --git a/doc/doxygen/Makefile.am b/doc/doxygen/Makefile.am
index 91e8b3c8c2fe6496d2e9fb40a2bf1cc6e02ab182..153d2bffbf8b0477290b9ca8a336623b543bf335 100644
--- a/doc/doxygen/Makefile.am
+++ b/doc/doxygen/Makefile.am
@@ -6,3 +6,5 @@ CURDIR=doc/doxygen
 
 include $(top_srcdir)/am/doxygen
 include $(top_srcdir)/am/global-rules
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/dune-istl-config.cmake.in b/dune-istl-config.cmake.in
new file mode 100644
index 0000000000000000000000000000000000000000..a2ec4a44482ab7f4125b021c157bd5e1be076854
--- /dev/null
+++ b/dune-istl-config.cmake.in
@@ -0,0 +1,17 @@
+if(NOT @DUNE_MOD_NAME@_FOUND)
+#import the target
+#include("@CMAKE_BINARY_DIR@/@DUNE_MOD_NAME@-targets.cmake")
+
+#report other information
+set(@DUNE_MOD_NAME@_PREFIX "@CMAKE_SOURCE_DIR@")
+set(@DUNE_MOD_NAME@_INCLUDE_DIRS "@CMAKE_SOURCE_DIR@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
+set(@DUNE_MOD_NAME@_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
+set(@DUNE_MOD_NAME@_LIBRARIES "")
+set(@DUNE_MOD_NAME@_DEPENDS "@DUNE_DEPENDS@")
+set(@DUNE_MOD_NAME@_SUGGESTS "@DUNE_SUGGESTS@")
+set(@DUNE_MOD_NAME@_MODULE_PATH "@CMAKE_SOURCE_DIR@/cmake/modules")
+endif(NOT @DUNE_MOD_NAME@_FOUND)
\ No newline at end of file
diff --git a/dune-istl-version.cmake.in b/dune-istl-version.cmake.in
new file mode 100644
index 0000000000000000000000000000000000000000..a1c2199d972b8943a646d4feb40d12e9e239b141
--- /dev/null
+++ b/dune-istl-version.cmake.in
@@ -0,0 +1,8 @@
+set(PACKAGE_VERSION "@DUNE_MOD_VERSION@")
+
+if(NOT "${PACKAGE_FIND_VERSION}" VERSION_GREATER "@DUNE_MOD_VERSION@")
+  set (PACKAGE_VERSION_COMPATIBLE 1) # compatible with older
+  if ("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "@DUNE_MOD_VERSION@")
+    set(PACKAGE_VERSION_EXACT 1) #exact match for this version
+  endif()
+endif()
diff --git a/dune/CMakeLists.txt b/dune/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e93d9cba6bc17643f35959eaac7fb9c7afe603a3
--- /dev/null
+++ b/dune/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(istl)
diff --git a/dune/Makefile.am b/dune/Makefile.am
index ff5e1718f16d74cf88880a72a230e684b9720c7a..6a5198473d18f321b77464b65f28f4431a9b27d0 100644
--- a/dune/Makefile.am
+++ b/dune/Makefile.am
@@ -3,3 +3,5 @@
 SUBDIRS = istl
 
 include $(top_srcdir)/am/global-rules
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/dune/istl/CMakeLists.txt b/dune/istl/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9209396cdbad0480d4c5e981485a79fb76e6b7e1
--- /dev/null
+++ b/dune/istl/CMakeLists.txt
@@ -0,0 +1,42 @@
+add_subdirectory("paamg")
+add_subdirectory("tutorial")
+add_subdirectory("test" EXCLUDE_FROM_ALL)
+
+#install headers
+install(FILES
+   basearray.hh
+   bcrsmatrix.hh
+   bdmatrix.hh
+   btdmatrix.hh
+   bvector.hh
+   diagonalmatrix.hh
+   gsetc.hh
+   ilu.hh
+   ilusubdomainsolver.hh
+   io.hh
+   istlexception.hh
+   matrix.hh
+   matrixindexset.hh
+   matrixmarket.hh
+   matrixmatrix.hh
+   matrixredistribute.hh
+   matrixutils.hh
+   multitypeblockmatrix.hh
+   multitypeblockvector.hh
+   novlpschwarz.hh
+   operators.hh
+   overlappingschwarz.hh
+   owneroverlapcopy.hh
+   pardiso.hh
+   preconditioners.hh
+   repartition.hh
+   scalarproducts.hh
+   scaledidmatrix.hh
+   schwarz.hh
+   solvercategory.hh
+   solvers.hh
+   solvertype.hh
+   superlu.hh
+   supermatrix.hh
+   vbvector.hh
+   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/istl)
diff --git a/dune/istl/Makefile.am b/dune/istl/Makefile.am
index 827a7fbf08f3c002b0d541cda52434244ad91c1e..8c2474f89520a2081897db6ccf5e9b719b9abe41 100644
--- a/dune/istl/Makefile.am
+++ b/dune/istl/Makefile.am
@@ -41,3 +41,5 @@ istl_HEADERS = basearray.hh \
 
 
 include $(top_srcdir)/am/global-rules
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/dune/istl/paamg/CMakeLists.txt b/dune/istl/paamg/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5771c8600b213711ad44bb5ea5e12e58e3e4f7d2
--- /dev/null
+++ b/dune/istl/paamg/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_subdirectory("test" EXCLUDE_FROM_ALL)
+
+#install headers
+install(FILES aggregates.hh dependency.hh galerkin.hh graph.hh
+          indicescoarsener.hh properties.hh globalaggregates.hh
+          hierarchy.hh construction.hh
+          transfer.hh smoother.hh amg.hh kamg.hh combinedfunctor.hh
+          graphcreator.hh parameters.hh renumberer.hh pinfo.hh
+	DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/istl/paamg)
diff --git a/dune/istl/paamg/Makefile.am b/dune/istl/paamg/Makefile.am
index dc08c43ccc0b846758b72c095b20a45a61f6e870..7e3592bd00342b477631a961cda61568a6051b69 100644
--- a/dune/istl/paamg/Makefile.am
+++ b/dune/istl/paamg/Makefile.am
@@ -8,3 +8,5 @@ paamg_HEADERS = aggregates.hh dependency.hh galerkin.hh graph.hh \
 	graphcreator.hh parameters.hh renumberer.hh pinfo.hh
 
 include $(top_srcdir)/am/global-rules
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/dune/istl/paamg/test/.gitignore b/dune/istl/paamg/test/.gitignore
index 09a7b1ca26cc9a6e2ded5dcf1299c458ee9adc2d..db77d078d1ad318a7713f237ea7b3d576fdf1a7f 100644
--- a/dune/istl/paamg/test/.gitignore
+++ b/dune/istl/paamg/test/.gitignore
@@ -12,3 +12,4 @@ pamg_comm_repart_test
 transfertest
 kamgtest
 fastamg
+
diff --git a/dune/istl/paamg/test/CMakeLists.txt b/dune/istl/paamg/test/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..421efb18fff9c195e15920181b5e75c2841cba32
--- /dev/null
+++ b/dune/istl/paamg/test/CMakeLists.txt
@@ -0,0 +1,38 @@
+if(MPI_FOUND)
+  set(MPITESTS  galerkintest hierarchytest transfertest)
+endif(MPI_FOUND)
+
+if(ParMETIS_FOUND)
+  set(PARMETISTESTS pamgtest pamg_comm_repart_test)
+endif(ParMETIS_FOUND)
+
+set(NORMALTESTS amgtest fastamg graphtest kamgtest)
+set(ALLTESTS ${MPITESTS} ${PARMETISTESTS} ${NORMALTESTS})
+
+# We do not want want to build the tests during make all,
+# but just build them on demand
+add_directory_test_target(_test_target)
+add_dependencies(${_test_target} ${ALLTESTS})
+
+add_executable(amgtest "amgtest.cc")
+add_dune_superlu_flags(amgtest)
+add_executable(fastamg "fastamg.cc")
+add_dune_superlu_flags(fastamg)
+add_executable(galerkintest "galerkintest.cc")
+add_executable(graphtest "graphtest.cc")
+add_executable(hierarchytest "hierarchytest.cc")
+add_executable(kamgtest "kamgtest.cc")
+add_dune_superlu_flags(kamgtest)
+add_executable(pamg_comm_repart_test "parallelamgtest.cc")
+set_target_properties(pamg_comm_repart_test PROPERTIES COMPILE_FLAGS "-DAMG_REPART_ON_COMM_GRAPH")
+add_executable(pamgtest "parallelamgtest.cc")
+add_dune_superlu_flags(pamgtest)
+add_executable(transfertest "transfertest.cc")
+
+foreach(_exe ${ALLTESTS})
+  target_link_libraries(${_exe} "dunecommon")
+  add_test(${_exe} ${_exe})
+endforeach(_exe ${ALLTESTS})
+
+add_dune_mpi_flags("${MPITESTS}")
+add_dune_parmetis_flags("${PARMETISTESTS}")
diff --git a/dune/istl/paamg/test/Makefile.am b/dune/istl/paamg/test/Makefile.am
index b031632e31d17e3bfab64dcf54376bcc7047e89f..cde53b13ca66f8963b18ed01a19ad8b98e701117 100644
--- a/dune/istl/paamg/test/Makefile.am
+++ b/dune/istl/paamg/test/Makefile.am
@@ -96,3 +96,5 @@ pamg_comm_repart_test_LDADD =				\
 
 
 include $(top_srcdir)/am/global-rules
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/dune/istl/test/.gitignore b/dune/istl/test/.gitignore
index 0ead72bbac5e1f58569ee9fe1e6519e1b19b1662..bd879dc396e79dac65d75e373ea4b6bbde813920 100644
--- a/dune/istl/test/.gitignore
+++ b/dune/istl/test/.gitignore
@@ -30,3 +30,4 @@ testvec
 superluctest
 seqmatrixmarkettest
 solvertest
+
diff --git a/dune/istl/test/CMakeLists.txt b/dune/istl/test/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9ea18d131f35caf6627856c9ca6fe91b1618ad86
--- /dev/null
+++ b/dune/istl/test/CMakeLists.txt
@@ -0,0 +1,95 @@
+set(NORMALTEST
+  basearraytest
+  bvectortest
+  bcrsbuildtest
+  dotproducttest
+  iotest
+  matrixiteratortest
+  matrixtest
+  matrixutilstest
+  mmtest
+  mv
+  scaledidmatrixtest
+  seqmatrixmarkettest
+  vbvectortest)
+
+if(HAVE_PARDISO)
+  set(PARDISOTEST test_pardiso)
+endif(HAVE_PARDISO)
+
+if(SUPERLU_FOUND)
+  set(SUPERLUTESTS
+  complexrhstest superlutest superluztest superluctest superlustest
+    overlappingschwarztest)
+endif(SUPERLU_FOUND)
+
+if(HAVE_MPI)
+  set(MPITESTS vectorcommtest matrixmarkettest matrixredisttest)
+endif(HAVE_MPI)
+
+set(ALLTESTS ${MPITESTS} ${NORMALTEST} ${PARDISOTEST} ${SUPERLUTESTS})
+
+
+# We do not want want to build the tests during make all,
+# but just build them on demand
+add_directory_test_target(_test_target)
+add_dependencies(${_test_target} ${ALLTESTS})
+
+
+include(DuneMPI)
+
+# Provide source files
+add_executable(basearraytest "basearraytest.cc")
+add_executable(dotproducttest "dotproducttest.cc")
+add_executable(matrixutilstest "matrixutilstest.cc")
+add_executable(matrixtest "matrixtest.cc")
+add_executable(bvectortest "bvectortest.cc")
+add_executable(vbvectortest "vbvectortest.cc")
+add_executable(bcrsbuildtest "bcrsbuild.cc")
+add_executable(matrixiteratortest "matrixiteratortest.cc")
+add_executable(mmtest mmtest.cc)
+add_executable(mv "mv.cc")
+add_executable(iotest "iotest.cc")
+add_executable(scaledidmatrixtest "scaledidmatrixtest.cc")
+add_executable(seqmatrixmarkettest "matrixmarkettest.cc")
+#set_target_properties(seqmatrixmarkettest PROPERTIES COMPILE_FLAGS
+#  "-DMMSEQUENTIAL ${MPI_DUNE_COMPILE_FLAGS} -DENABLE_MPI=1 -DMPICH_SKIP_MPICXX -DMPIPP_H")
+
+if(HAVE_PARDISO)
+  add_executable(pardiso_test test_pardiso.cc)
+
+  # TODO add pardiso flags
+endif(HAVE_PARDISO)
+
+if(SUPERLU_FOUND)
+  add_executable(complexrhstest complexrhstest.cc)
+  set_property(TARGET complexrhstest APPEND PROPERTY COMPILE_DEFINITIONS "SUPERLU_NTYPE=3")
+
+  add_executable(superlutest "superlutest.cc")
+
+  add_executable(superlustest "superlutest.cc")
+  set_property(TARGET superlustest APPEND PROPERTY COMPILE_DEFINITIONS "SUPERLU_NTYPE=0")
+
+  add_executable(superluctest "superlutest.cc")
+  set_property(TARGET superluctest APPEND PROPERTY COMPILE_DEFINITIONS "SUPERLU_NTYPE=2")
+
+  add_executable(superluztest "superlutest.cc")
+  set_property(TARGET superluztest APPEND PROPERTY COMPILE_DEFINITIONS "SUPERLU_NTYPE=3")
+
+  add_executable(overlappingschwarztest "overlappingschwarztest.cc")
+
+  add_dune_superlu_flags("${SUPERLUTESTS}")
+endif(SUPERLU_FOUND)
+
+if(HAVE_MPI)
+  add_executable(matrixredisttest "matrixredisttest.cc")
+  add_executable(vectorcommtest "vectorcommtest.cc")
+  add_executable(matrixmarkettest "matrixmarkettest.cc")
+  add_dune_mpi_flags("${MPITESTS}")
+  add_dune_parmetis_flags(matrixredisttest)
+endif(HAVE_MPI)
+
+foreach(_exe ${ALLTESTS})
+  target_link_libraries(${_exe} "dunecommon")
+  add_test(${_exe} ${_exe})
+endforeach(_exe ${ALLTESTS})
diff --git a/dune/istl/test/Makefile.am b/dune/istl/test/Makefile.am
index bad932b37ae77056579dbd8f8b47be374f67c1c2..f6d05b0759018b6c76029f1cea5d699b6b976cba 100644
--- a/dune/istl/test/Makefile.am
+++ b/dune/istl/test/Makefile.am
@@ -140,3 +140,5 @@ if MPI
 	$(LDADD)
 endif
 include $(top_srcdir)/am/global-rules
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/dune/istl/tutorial/CMakeLists.txt b/dune/istl/tutorial/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b6f93928b51879436163b5d2ac31faab9de4b08
--- /dev/null
+++ b/dune/istl/tutorial/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_executable(example "example.cc")
+add_dune_mpi_flags(example)
+add_dune_boost_flags(example)
+target_link_libraries(example "dunecommon")
diff --git a/dune/istl/tutorial/Makefile.am b/dune/istl/tutorial/Makefile.am
index f9e3b195daf8b9c2a04ac733b36d227eb145b002..aad2b566bbd9c40d104a5e19742343d6621fc9a3 100644
--- a/dune/istl/tutorial/Makefile.am
+++ b/dune/istl/tutorial/Makefile.am
@@ -7,3 +7,5 @@ example_SOURCES = example.cc
 example_CPPFLAGS = $(AM_CPPFLAGS) $(BOOST_CPPFLAGS) $(DUNE_CPPFLAGS)
 
 include $(top_srcdir)/am/global-rules
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/m4/CMakeLists.txt b/m4/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..562b6debd16eecead5e98a709b907de61175bbd7
--- /dev/null
+++ b/m4/CMakeLists.txt
@@ -0,0 +1,4 @@
+install(PROGRAMS
+  dune_istl.m4 pardiso.m4 superlu-dist.m4 superlu.m4
+  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aclocal)
+
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 9854083740bef7f09dae08f3da50953a03d16ca9..cf8d324aee916da31276ba22aead304ac3a273e4 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -9,6 +9,6 @@ ALLM4S = 					\
 aclocaldir = $(datadir)/aclocal
 aclocal_DATA = $(ALLM4S)
 
-EXTRA_DIST = $(ALLM4S)
+EXTRA_DIST = CMakeLists.txt $(ALLM4S)
 
 include $(top_srcdir)/am/global-rules