CMake Find MPIEXEC without FindMPI

CMake superprojects may have one project that builds binary executables with MPI and another project that runs those targets. To avoid the overhead of FindMPI, one can use the following find_program() command to use “mpiexec”.

find_program(MPIEXEC_EXECUTABLE
NAMES mpiexec
HINTS ${MPI_ROOT} ENV MPI_ROOT ENV I_MPI_ROOT
PATHS /usr/lib64 ENV MINGWROOT ENV MSMPI_BIN
PATH_SUFFIXES bin openmpi/bin mpich/bin
DOC "Runs an MPI program"
REQUIRED
)