Skip to content
Snippets Groups Projects
Commit e59f2fa6 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Automatically set the with_mpi option from CMake using command line arguments

parent 5bc4cdc7
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,11 @@ function(dune_add_generated_executable)
message(FATAL_ERROR "Unrecognized arguments in dune_add_generated_executable. This usually indicates a typo.")
endif()
set(MPI_OPTION "0")
if(MPI_FOUND)
set(MPI_OPTION "1")
endif()
# Apply defaults and enforce requirements
if(NOT GEN_TARGET)
message(FATAL_ERROR "Need to specify the TARGET parameter for dune_add_generated_executable")
......@@ -139,6 +144,7 @@ function(dune_add_generated_executable)
--target-name ${GEN_TARGET}
--driver-file ${GEN_SOURCE}
--project-basedir ${CMAKE_BINARY_DIR}
--with-mpi ${MPI_OPTION}
${GEN_FORM_COMPILER_ARGS}
DEPENDS ${GEN_UFLFILE} ${UFL2PDELAB_SOURCES} ${GEN_DEPENDS} ${DUNE_CODEGEN_ADDITIONAL_PYTHON_SOURCES}
COMMENT "Generating driver for the target ${GEN_TARGET}"
......@@ -199,6 +205,7 @@ function(dune_add_generated_executable)
--ini-file ${GEN_INIFILE}
--target-name ${GEN_TARGET}
--operator-to-build ${op}
--with-mpi ${MPI_OPTION}
${ANALYZE_GRID_OPTION}
DEPENDS ${GEN_UFLFILE} ${UFL2PDELAB_SOURCES} ${GEN_DEPENDS} ${DUNE_CODEGEN_ADDITIONAL_PYTHON_SOURCES} ${ANALYZE_GRID_FILE}
COMMENT "Generating operator file ${depdata___${op}} for the target ${GEN_TARGET}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment