--- dolfin-1.6.0.orig/cmake/modules/FindPETSc.cmake	2015-07-28 17:05:55.000000000 +0200
+++ dolfin-1.6.0/cmake/modules/FindPETSc.cmake	2016-06-27 17:16:02.484402705 +0200
@@ -207,13 +207,7 @@
 
 endif()
 
-# Build PETSc test program
-if (DOLFIN_SKIP_BUILD_TESTS)
-  set(PETSC_TEST_RUNS TRUE)
-  set(PETSC_VERSION "UNKNOWN")
-  set(PETSC_VERSION_OK TRUE)
-elseif (FOUND_PETSC_CONF)
-
+if (FOUND_PETSC_CONF)
   # Set flags for building test program
   set(CMAKE_REQUIRED_INCLUDES ${PETSC_INCLUDE_DIRS})
   set(CMAKE_REQUIRED_LIBRARIES ${PETSC_LIBRARIES})
@@ -271,7 +265,10 @@
     set(PETSC_VERSION_OK TRUE)
   endif()
   mark_as_advanced(PETSC_VERSION_OK)
+endif()
 
+  # Build PETSc test program
+if (NOT DOLFIN_SKIP_BUILD_TESTS AND FOUND_PETSC_CONF)
   # Run PETSc test program
   set(PETSC_TEST_LIB_CPP
     "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/petsc_test_lib.cpp")
@@ -359,7 +356,9 @@
   else()
     message(STATUS "PETSc configured without Cusp support")
   endif()
-
+else()
+  set(PETSC_TEST_RUNS TRUE)
+ 
 endif()
 
 # Check sizeof(PetscInt)
