From 2081b6da60a7da26bbb89bd0db313daa51880e22 Mon Sep 17 00:00:00 2001
From: Martin Beseda <martin.beseda@vsb.cz>
Date: Tue, 22 Oct 2019 01:36:03 +0200
Subject: [PATCH] [WIP] [FIX] [Win] Trying to fix compilation with MS-MPI.

---
 src/CMakeLists.txt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2fc95299..94af3154 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -139,12 +139,16 @@ IF("${BUILD_LIB}" STREQUAL "yes")
         SET(GFORT gfortran)
     ENDIF()
 
+    set(MPI_TARGETS MPI::MPI_CXX MPI::MPI_C)
+    if(WIN32)
+       set(MPI_TARGETS "")
+    endif()
+
     TARGET_LINK_LIBRARIES(
         lib4neuro
 
         PUBLIC
-        MPI::MPI_CXX
-        MPI::MPI_C
+        ${MPI_TARGETS}
         ${MPI_C_LIBRARIES}
         ${MPI_CXX_LIBRARIES}
 
-- 
GitLab