gmxManageMPI.cmake: convert MPI FLAGS to lists
authorChristoph Junghans <junghans@votca.org>
Fri, 10 Jan 2020 00:37:09 +0000 (17:37 -0700)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 13 Jan 2020 06:44:20 +0000 (07:44 +0100)
Convert MPI FLAGS to lists as otherwise space will get quoted in
CFLAGS in gmxCFlags.cmake.

Change-Id: Ieee4b68d254261f079d954443322faf040e8b6e9

cmake/gmxManageMPI.cmake
cmake/gmxTestMPI_IN_PLACE.cmake

index 0a614a430cae1577554e43a1abf2ccbdccdb329e..f5d8fd637dc6dc54931b656fa2dea4cc9630f66c 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2016,2019, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2019,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -51,7 +51,9 @@ if(GMX_MPI)
       find_package(MPI)
       if(MPI_C_FOUND)
           set(MPI_COMPILE_FLAGS ${MPI_C_COMPILE_FLAGS})
+          separate_arguments(MPI_COMPILE_FLAGS)
           set(MPI_LINKER_FLAGS ${MPI_C_LINK_FLAGS})
+          separate_arguments(MPI_C_LINK_FLAGS)
           include_directories(SYSTEM ${MPI_C_INCLUDE_PATH})
           list(APPEND GMX_COMMON_LIBRARIES ${MPI_C_LIBRARIES})
       endif()
index 1d53dae33bbc36e782c27a101568d31137775335..c56e05c3ae94d8b87fa91b5dfdb0baee27bcc5d2 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2009,2011,2012,2014,2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2009,2011,2012,2014,2015,2016,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -44,7 +44,13 @@ MACRO(GMX_TEST_MPI_IN_PLACE VARIABLE)
   if(NOT DEFINED MPI_IN_PLACE_COMPILE_OK)
     MESSAGE(STATUS "Checking for MPI_IN_PLACE")
 
-    set(CMAKE_REQUIRED_FLAGS ${MPI_COMPILE_FLAGS})
+    if(CMAKE_VERSION VERSION_LESS 3.12)
+      foreach(_FLAG ${MPI_COMPILE_FLAGS})
+        set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${_FLAG}")
+      endforeach()
+    else()
+      list(JOIN MPI_COMPILE_FLAGS " " CMAKE_REQUIRED_FLAGS)
+    endif()
     set(CMAKE_REQUIRED_INCLUDES ${MPI_INCLUDE_PATH})
     set(CMAKE_REQUIRED_LIBRARIES ${MPI_LIBRARIES})
     check_cxx_source_compiles(