Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2709


Ignore:
Timestamp:
Feb 28, 2009, 7:15:37 PM (15 years ago)
Author:
rgrieder
Message:

Added run scripts for client1, client2 and server.
They will be copied to the same locations as the original run scripts.
Furthermore specifying "—directory foobar" to the command line will put the config and log files in the subfolder foobar.
—> server goes to config/server, etc.
That should avoid conflicts when using the same logfile from multiple executables.

Location:
code/branches/buildsystem3
Files:
3 edited
6 copied

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem3/bin/CMakeLists.txt

    r2685 r2709  
    2121 #    Reto Grieder
    2222 #  Description:
    23  #    Creates a run-script in the root directory of the build tree.
     23 #    Creates run scripts in the root directory of the build tree and
     24 #    the runtime output directory.
    2425 #
    2526
    26 ############ Configure Dev Build ##############
    27 
    28 
    29 ################ Run Scripts ##################
    30 
    31 # Create a run script for Windows to manually add the DLL path when executing
     27# Create run scripts for Windows to manually add the DLL path when executing
    3228IF(WIN32)
    33   SET(RUN_SCRIPT run.bat)
     29  SET(RUN_SCRIPTS run.bat client1.bat client2.bat server.bat)
    3430ELSEIF(UNIX)
    35   SET(RUN_SCRIPT run)
     31  SET(RUN_SCRIPTS run client1 client1 server)
    3632ENDIF()
    3733
     
    5147  STRING(REPLACE "/" "\\" CURRENT_RUNTIME_DIR_WINDOWS ${CURRENT_RUNTIME_DIR})
    5248
    53   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${RUN_SCRIPT}.in ${CURRENT_RUNTIME_DIR}/${RUN_SCRIPT} @ONLY)
    54   IF(_subdir STREQUAL _default_subdir)
    55     # Convenience script to be used when sitting in the binary directory. Defaults to Debug for msvc.
    56     CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${RUN_SCRIPT}.in ${CMAKE_BINARY_DIR}/${RUN_SCRIPT} @ONLY)
    57   ENDIF()
     49  FOREACH(_script ${RUN_SCRIPTS})
     50    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_script}.in ${CURRENT_RUNTIME_DIR}/${_script} @ONLY)
     51    IF(_subdir STREQUAL _default_subdir)
     52      # Convenience script to be used when sitting in the binary directory. Defaults to Debug for msvc.
     53      CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_script}.in ${CMAKE_BINARY_DIR}/${_script} @ONLY)
     54    ENDIF()
     55  ENDFOREACH(_script)
    5856
    5957  # In order to evaluate at run time whether it is a dev build in the build tree,
  • code/branches/buildsystem3/bin/client1.bat.in

    r2707 r2709  
    33@WINDOWS_DRIVE_CHANGE@
    44cd @CURRENT_RUNTIME_DIR_WINDOWS@
    5 @ORXONOX_EXECUTABLE_NAME@
     5@ORXONOX_EXECUTABLE_NAME@ --state client --directory client1
    66pause
  • code/branches/buildsystem3/bin/client1.in

    r2707 r2709  
    22# convenience script for starting orxonox on Linux
    33
    4 cd @CURRENT_RUNTIME_DIR@ && exec ./@ORXONOX_EXECUTABLE_NAME@ $@
     4cd @CURRENT_RUNTIME_DIR@ && exec ./@ORXONOX_EXECUTABLE_NAME@ --state client --directory client1 $@
  • code/branches/buildsystem3/bin/client2.bat.in

    r2707 r2709  
    33@WINDOWS_DRIVE_CHANGE@
    44cd @CURRENT_RUNTIME_DIR_WINDOWS@
    5 @ORXONOX_EXECUTABLE_NAME@
     5@ORXONOX_EXECUTABLE_NAME@ --state client --directory client2
    66pause
  • code/branches/buildsystem3/bin/client2.in

    r2707 r2709  
    22# convenience script for starting orxonox on Linux
    33
    4 cd @CURRENT_RUNTIME_DIR@ && exec ./@ORXONOX_EXECUTABLE_NAME@ $@
     4cd @CURRENT_RUNTIME_DIR@ && exec ./@ORXONOX_EXECUTABLE_NAME@ --state client --directory client2 $@
  • code/branches/buildsystem3/bin/server.bat.in

    r2707 r2709  
    33@WINDOWS_DRIVE_CHANGE@
    44cd @CURRENT_RUNTIME_DIR_WINDOWS@
    5 @ORXONOX_EXECUTABLE_NAME@
     5@ORXONOX_EXECUTABLE_NAME@ --state server --directory server
    66pause
  • code/branches/buildsystem3/bin/server.in

    r2707 r2709  
    22# convenience script for starting orxonox on Linux
    33
    4 cd @CURRENT_RUNTIME_DIR@ && exec ./@ORXONOX_EXECUTABLE_NAME@ $@
     4cd @CURRENT_RUNTIME_DIR@ && exec ./@ORXONOX_EXECUTABLE_NAME@ --state server --directory server $@
  • code/branches/buildsystem3/src/core/Core.cc

    r2703 r2709  
    7777
    7878    SetCommandLineArgument(mediaPath, "").information("PATH");
     79    SetCommandLineArgument(directory, "").information("DIR");
    7980
    8081    /**
     
    426427#endif
    427428        }
     429
     430        // Option to put all the config and log files in a separate folder
     431        if (!CommandLine::getArgument("directory")->hasDefaultValue())
     432        {
     433            std::string directory(CommandLine::getValue("directory"));
     434            configPath_g = configPath_g / directory;
     435            logPath_g    = logPath_g    / directory;
     436        }
    428437    }
    429438
  • code/branches/buildsystem3/src/orxonox/Main.cc

    r2702 r2709  
    9292    using namespace orxonox;
    9393
    94     Core::postMainInitialisation();
    95 
    9694    // create a signal handler (only active for linux)
    9795    SignalHandler signalHandler;
     
    108106        COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
    109107    }
     108
     109    // Do this after parsing the command line to allow customisation
     110    Core::postMainInitialisation();
    110111
    111112    // Create the ConfigFileManager before creating the GameStates in order to have
Note: See TracChangeset for help on using the changeset viewer.