From 1a9ebd1694aeeb97dc073c0dde75ddb8cd91794b Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 6 Jul 2021 19:40:16 -0400 Subject: FindMPI: Honor MPI_CXX_SKIP_MPICXX when set as a normal variable Express the cache entry with `option()`. In combination with policies CMP0077 and CMP0102, this allows project code to control the switch with a variable: ``` set(MPI_CXX_SKIP_MPICXX TRUE) find_package(MPI COMPONENTS CXX) ``` --- Modules/FindMPI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index c48decb..43fdace 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1440,7 +1440,7 @@ foreach(LANG IN ITEMS C CXX Fortran) endif() if(_MPI_FIND_${LANG}) if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS ) - set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.") + option(MPI_CXX_SKIP_MPICXX "If true, the MPI-2 C++ bindings are disabled using definitions." FALSE) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_COMPILER_INCLUDE_DIRS))) -- cgit v0.12