diff --git a/cmake/AddOppRun.cmake b/cmake/AddOppRun.cmake index 96be49234..86b4bf7c8 100644 --- a/cmake/AddOppRun.cmake +++ b/cmake/AddOppRun.cmake @@ -214,6 +214,7 @@ function(generate_run_script) else() set(opp_run_executable ${OMNETPP_RUN}) endif() + set(opp_runall_script ${OMNETPP_RUNALL}) # substitute variables first, then generator expressions configure_file(${PROJECT_SOURCE_DIR}/cmake/run_artery.sh.in ${args_FILE} @ONLY) diff --git a/cmake/FindOmnetPP.cmake b/cmake/FindOmnetPP.cmake index 0c2ec32a1..ffe63a9a2 100644 --- a/cmake/FindOmnetPP.cmake +++ b/cmake/FindOmnetPP.cmake @@ -2,6 +2,7 @@ find_path(OMNETPP_ROOT NAMES bin/omnetpp PATHS ENV PATH PATH_SUFFIXES .. DOC "Pa find_path(OMNETPP_INCLUDE_DIR NAMES omnetpp.h PATHS ${OMNETPP_ROOT}/include DOC "OMNeT++ include directory") find_program(OMNETPP_MSGC NAMES nedtool opp_msgc PATHS ${OMNETPP_ROOT}/bin DOC "OMNeT++ message compiler") find_program(OMNETPP_RUN NAMES opp_run_release opp_run PATHS ${OMNETPP_ROOT}/bin DOC "OMNeT++ opp_run executable") +find_program(OMNETPP_RUNALL NAMES opp_runall PATHS ${OMNETPP_ROOT}/bin DOC "OMNeT++ opp_runall script") find_program(OMNETPP_RUN_DEBUG NAMES opp_run_dbg opp_run PATHS ${OMNETPP_ROOT}/bin DOC "OMNeT++ opp_run_dbg executable") get_filename_component(OMNETPP_ROOT "${OMNETPP_ROOT}" REALPATH) mark_as_advanced(OMNETPP_INCLUDE_DIR OMNETPP_MSGC OMNETPP_ROOT OMNETPP_RUN OMNETPP_RUN_DEBUG) diff --git a/cmake/run_artery.sh.in b/cmake/run_artery.sh.in index 56d02ca8f..1544326c7 100644 --- a/cmake/run_artery.sh.in +++ b/cmake/run_artery.sh.in @@ -1,6 +1,21 @@ #!/bin/bash +OPP_RUNALL=@opp_runall_script@ OPP_RUN=@opp_run_executable@ NED_FOLDERS="@opp_run_ned_folders@" LIBRARIES="@opp_run_libraries@" -$OPP_RUN -n $NED_FOLDERS $LIBRARIES $@ +RUNALL=false +for arg do + shift + [[ "$arg" == -j* ]] && RUNALL=true && J=$arg && continue + [[ "$arg" == -b* ]] && RUNALL=true && B=$arg && continue + # run opp_runall with default values for -j* and -b* options by just specifying '--all' + [[ "$arg" == "--all" ]] && RUNALL=true && continue + set -- "$@" "$arg" +done + +if [ "$RUNALL" = true ] ; then + $OPP_RUNALL $J $B $OPP_RUN -n $NED_FOLDERS $LIBRARIES $@ +else + $OPP_RUN -n $NED_FOLDERS $LIBRARIES $@ +fi