From 630d1815403ef8d872b70c6939971d0cc6ec47bf Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Wed, 10 Jan 2018 11:30:19 +0100
Subject: [PATCH] [CMake] Set forced OGS_USE_MPI=ON at the beginning of CMake
 run.

This will fix an error where the correct VTK library was not found
in the first CMake run but on susequent ones.
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 917906250dd..3d34337f7c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,9 @@ option(OGS_USE_PCH "Should pre-compiled headers be used?" ON)
 option(OGS_USE_CONAN "Should Conan package manager be used?" OFF)
 set(OGS_CONAN_BUILD "missing" CACHE STRING "Possible values: all, missing, \
     never or list of libs to build" )
+if(OGS_USE_PETSC)
+    set(OGS_USE_MPI ON CACHE BOOL "Use MPI" FORCE)
+endif()
 
 ### CMake includes ###
 include(scripts/cmake/PreFind.cmake)
@@ -191,7 +194,6 @@ endif()
 
 if(OGS_USE_PETSC)
     add_definitions(-DUSE_PETSC)
-    set(OGS_USE_MPI ON CACHE BOOL "Use MPI" FORCE)
 endif()
 
 # Use MPI
-- 
GitLab