From 0d565f52fcf758e19e16f3c22caf124aea2645e2 Mon Sep 17 00:00:00 2001 From: Guido Trensch <19706694+gtrensch@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:47:25 +0100 Subject: [PATCH 1/4] Fix processing of CMake option `with-mpi` --- cmake/ProcessOptions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/ProcessOptions.cmake b/cmake/ProcessOptions.cmake index d380d98cef..0bc81c1b95 100644 --- a/cmake/ProcessOptions.cmake +++ b/cmake/ProcessOptions.cmake @@ -457,7 +457,7 @@ endfunction() function( NEST_PROCESS_WITH_MPI ) # Find MPI set( HAVE_MPI OFF PARENT_SCOPE ) - if ( with-mpi ) + if ( NOT "${with-mpi}" STREQUAL "OFF" ) find_package( MPI REQUIRED ) if ( MPI_CXX_FOUND ) set( HAVE_MPI ON PARENT_SCOPE ) From 3e722d7a5533a16f64ce0a28615826f711da4755 Mon Sep 17 00:00:00 2001 From: Dennis Terhorst Date: Mon, 4 Mar 2024 11:25:24 +0100 Subject: [PATCH 2/4] Update cmake/ProcessOptions.cmake Co-authored-by: Hans Ekkehard Plesser --- cmake/ProcessOptions.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/ProcessOptions.cmake b/cmake/ProcessOptions.cmake index 0bc81c1b95..aaff79ed18 100644 --- a/cmake/ProcessOptions.cmake +++ b/cmake/ProcessOptions.cmake @@ -458,6 +458,10 @@ function( NEST_PROCESS_WITH_MPI ) # Find MPI set( HAVE_MPI OFF PARENT_SCOPE ) if ( NOT "${with-mpi}" STREQUAL "OFF" ) + if ( NOT ${with-mpi} STREQUAL "ON" ) + # if set, use this prefix + set( MPI_ROOT_DIR "${with-mpi}" ) + endif () find_package( MPI REQUIRED ) if ( MPI_CXX_FOUND ) set( HAVE_MPI ON PARENT_SCOPE ) From 4d59e33d39b9a33670a20e2e326b4e04e6310c96 Mon Sep 17 00:00:00 2001 From: Guido Trensch Date: Tue, 12 Mar 2024 12:21:11 +0100 Subject: [PATCH 3/4] unifying CMake options handling --- cmake/ProcessOptions.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/ProcessOptions.cmake b/cmake/ProcessOptions.cmake index aaff79ed18..2ef991f714 100644 --- a/cmake/ProcessOptions.cmake +++ b/cmake/ProcessOptions.cmake @@ -690,7 +690,7 @@ function( NEST_PROCESS_WITH_MPI4PY ) endfunction () function( NEST_PROCESS_USERDOC ) - if ( with-userdoc ) + if ( ${with-userdoc} STREQUAL "ON") message( STATUS "Configuring user documentation" ) find_package( Sphinx REQUIRED) find_package( Pandoc REQUIRED) @@ -701,7 +701,7 @@ function( NEST_PROCESS_USERDOC ) endfunction () function( NEST_PROCESS_DEVDOC ) - if ( with-devdoc ) + if ( ${with-devdoc} STREQUAL "ON" ) message( STATUS "Configuring developer documentation" ) find_package( Doxygen REQUIRED dot ) set( BUILD_DOXYGEN_DOCS ON PARENT_SCOPE ) @@ -710,7 +710,7 @@ function( NEST_PROCESS_DEVDOC ) endfunction () function( NEST_PROCESS_FULL_LOGGING ) - if ( with-full-logging ) + if ( ${with-full-logging} STREQUAL "ON" ) message( STATUS "Configuring full logging" ) set( ENABLE_FULL_LOGGING ON PARENT_SCOPE ) endif () From c280bdcc99ef04805cacf61cd656409700e042cc Mon Sep 17 00:00:00 2001 From: Hans Ekkehard Plesser Date: Tue, 12 Mar 2024 13:52:07 +0100 Subject: [PATCH 4/4] Correct according to CMake requirements. --- cmake/ProcessOptions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/ProcessOptions.cmake b/cmake/ProcessOptions.cmake index 2ef991f714..3cc12efab1 100644 --- a/cmake/ProcessOptions.cmake +++ b/cmake/ProcessOptions.cmake @@ -460,7 +460,7 @@ function( NEST_PROCESS_WITH_MPI ) if ( NOT "${with-mpi}" STREQUAL "OFF" ) if ( NOT ${with-mpi} STREQUAL "ON" ) # if set, use this prefix - set( MPI_ROOT_DIR "${with-mpi}" ) + set( MPI_ROOT "${with-mpi}" ) endif () find_package( MPI REQUIRED ) if ( MPI_CXX_FOUND )