Skip to content

Commit 3ddf5eb

Browse files
authoredMar 25, 2024··
Merge pull request #3148 from gtrensch/fix-issue2993-with-mpi-option
Make -Dwith-mpi respect provided path and ensure "default off" options are turned on only by explicit ON
2 parents 22a7bf3 + c280bdc commit 3ddf5eb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎cmake/ProcessOptions.cmake

+8-4
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,11 @@ endfunction()
420420
function( NEST_PROCESS_WITH_MPI )
421421
# Find MPI
422422
set( HAVE_MPI OFF PARENT_SCOPE )
423-
if ( with-mpi )
423+
if ( NOT "${with-mpi}" STREQUAL "OFF" )
424+
if ( NOT ${with-mpi} STREQUAL "ON" )
425+
# if set, use this prefix
426+
set( MPI_ROOT "${with-mpi}" )
427+
endif ()
424428
find_package( MPI REQUIRED )
425429
if ( MPI_CXX_FOUND )
426430
set( HAVE_MPI ON PARENT_SCOPE )
@@ -649,7 +653,7 @@ function( NEST_PROCESS_WITH_MPI4PY )
649653
endfunction ()
650654

651655
function( NEST_PROCESS_USERDOC )
652-
if ( with-userdoc )
656+
if ( ${with-userdoc} STREQUAL "ON")
653657
message( STATUS "Configuring user documentation" )
654658
find_package( Sphinx REQUIRED)
655659
find_package( Pandoc REQUIRED)
@@ -660,7 +664,7 @@ function( NEST_PROCESS_USERDOC )
660664
endfunction ()
661665

662666
function( NEST_PROCESS_DEVDOC )
663-
if ( with-devdoc )
667+
if ( ${with-devdoc} STREQUAL "ON" )
664668
message( STATUS "Configuring developer documentation" )
665669
find_package( Doxygen REQUIRED dot )
666670
set( BUILD_DOXYGEN_DOCS ON PARENT_SCOPE )
@@ -669,7 +673,7 @@ function( NEST_PROCESS_DEVDOC )
669673
endfunction ()
670674

671675
function( NEST_PROCESS_FULL_LOGGING )
672-
if ( with-full-logging )
676+
if ( ${with-full-logging} STREQUAL "ON" )
673677
message( STATUS "Configuring full logging" )
674678
set( ENABLE_FULL_LOGGING ON PARENT_SCOPE )
675679
endif ()

0 commit comments

Comments
 (0)
Please sign in to comment.