Merge branch 'release-4-0-patches'
[alexxy/gromacs.git] / cmake / gmxTestMPI_IN_PLACE.cmake
1 # - Define macro to check if MPI_IN_PLACE exists
2 #
3 #  GMX_TEST_MPI_IN_PLACE(VARIABLE)
4 #
5 #  VARIABLE will be set to true if MPI_IN_PLACE exists
6 #
7
8 MACRO(GMX_TEST_MPI_IN_PLACE VARIABLE)
9     MESSAGE(STATUS "Checking for MPI_IN_PLACE")
10     # First check without any special flags
11     TRY_COMPILE(MPI_IN_PLACE_COMPILE_OK ${CMAKE_BINARY_DIR}
12                     "${CMAKE_SOURCE_DIR}/cmake/TestMPI_IN_PLACE.c"
13                     COMPILE_DEFINITIONS )
14
15     if(MPI_IN_PLACE_COMPILE_OK)
16     MESSAGE(STATUS "Checking for MPI_IN_PLACE - yes")
17         set(${VARIABLE} ${MPI_IN_PLACE_COMPILE_OK} 
18                 "Result of test for MPI_IN_PLACE")
19     else(MPI_IN_PLACE_COMPILE_OK)
20         MESSAGE(STATUS "Checking for MPI_IN_PLACE - no")
21     endif(MPI_IN_PLACE_COMPILE_OK)
22 ENDMACRO(GMX_TEST_MPI_IN_PLACE VARIABLE)
23
24
25