diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63061c76aaaee2f2868d3bb5a0049b4dce7e6392..453ae75e5c9d59a75e3fef8a5293f38a8250e923 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@
 #
 ###
 cmake_minimum_required (VERSION 3.0)
-project (SPM C)
+project (SPM C Fortran)
 
 # Check if compiled independently or within another project
 if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
@@ -40,6 +40,21 @@ else()
     "Choose between int32 and int64 for integer representation" ON)
 endif()
   
+if ( PASTIX_WITH_FORTRAN )
+  set( SPM_WITH_FORTRAN ${SPM_WITH_FORTRAN} )
+else()
+  option(SPM_WITH_FORTRAN
+    "Enable Fortran files/interface/examples to be compiled" ON)
+endif()
+
+if (SPM_WITH_FORTRAN)
+  include(FortranCInterface)
+  FortranCInterface_HEADER(src/FCmangle.h
+    MACRO_NAMESPACE "FC_"
+    SYMBOL_NAMESPACE "FC_")
+  link_directories( ${CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES} )
+endif()
+
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
 include(GenSPMPkgConfig)
@@ -206,3 +221,5 @@ add_documented_files(
   src/spm_dof_extend.c
   src/spm_integers.c
   )
+
+add_subdirectory(tests)
diff --git a/src/spm_read_driver.c b/src/spm_read_driver.c
index 1077595cf96f921932413a1d188525810d776af5..d07c461b78b1497df782989915667b5fce96b8d9 100644
--- a/src/spm_read_driver.c
+++ b/src/spm_read_driver.c
@@ -64,9 +64,9 @@
  *******************************************************************************/
 int
 spmReadDriver( spm_driver_t  driver,
-               const char      *filename,
-               spmatrix_t    *spm,
-               MPI_Comm         comm )
+               const char   *filename,
+               spmatrix_t   *spm,
+               MPI_Comm      comm )
 {
     int mpirank = 0;
     /* int mpiinit; */