Skip to content

Commit

Permalink
conditional to avoid extra whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 committed Oct 28, 2024
1 parent 13c09e7 commit 724b3b2
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions cmake/macros/SundialsAddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,25 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE)
if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE)
OR (SUNDIALS_TEST_MPIRUN_COMMAND)))
if(SUNDIALS_TEST_MPIRUN_COMMAND)
set(RUN_COMMAND
"${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}"
)
if(MPIEXEC_PREFLAGS)
set(RUN_COMMAND
"${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}"
)
else()
set(RUN_COMMAND
"${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}"
)
endif()
elseif(MPIEXEC_EXECUTABLE)
set(RUN_COMMAND
"${MPIEXEC_EXECUTABLE} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}"
)
if(MPIEXEC_PREFLAGS)
set(RUN_COMMAND
"${MPIEXEC_EXECUTABLE} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}"
)
else()
set(RUN_COMMAND
"${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}"
)
endif()
endif()

# remove trailing white space (empty MPIEXEC_PREFLAGS) as it can cause
Expand Down

0 comments on commit 724b3b2

Please sign in to comment.