Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7346 for code/branches


Ignore:
Timestamp:
Sep 4, 2010, 1:10:43 AM (14 years ago)
Author:
rgrieder
Message:

Added "doc_internal" target. It generates additional documentation from the executable.
That enables to gather information at run time (e.g. SetConsoleCommand, SetCommandLineArgument, registerNetworkFunction, etc.) and then write useful Doxygen documentation to one file.
Currently there is no implementation, just a stub in src/orxonox/Main.cc that can be extended.

Location:
code/branches/doc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/doc/doc/api/CMakeLists.txt

    r7334 r7346  
    4646  #ENDIF (NOT DVIPS_CONVERTER)
    4747
     48  SET(INTERNAL_DOCFILE ${CMAKE_CURRENT_BINARY_DIR}/Internal.dox)
     49  IF(WIN32)
     50    SET(_working_dir ${RUNTIME_LIBRARY_DIRECTORY})
     51  ELSE()
     52    SET(_working_dir ${CMAKE_CURRENT_BINARY_DIR})
     53  ENDIF()
     54  ADD_CUSTOM_COMMAND(
     55    OUTPUT ${INTERNAL_DOCFILE}
     56    COMMAND orxonox-main
     57    ARGS --noIOConsole --generateDoc ${INTERNAL_DOCFILE}
     58    WORKING_DIRECTORY ${_working_dir}
     59    COMMENT "Generating additional Doxygen documentation from Orxonox executable"
     60  )
     61  ADD_CUSTOM_TARGET(doc_internal DEPENDS ${INTERNAL_DOCFILE})
     62
    4863  IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in)
    4964    # use (configured) doxy.config from (out of place) BUILD tree:
  • code/branches/doc/doc/api/doxy.config.in

    r7335 r7346  
    589589                         @CMAKE_CURRENT_SOURCE_DIR@ \
    590590                         @CMAKE_BINARY_DIR@/src/OrxonoxConfig.h \
    591                          @CMAKE_BINARY_DIR@/src/SpecialConfig.h
     591                         @CMAKE_BINARY_DIR@/src/SpecialConfig.h \
     592                         @INTERNAL_DOCFILE@
    592593
    593594# This tag can be used to specify the character encoding of the source files
  • code/branches/doc/src/orxonox/Main.cc

    r7335 r7346  
    6161    SetCommandLineSwitch(dedicatedClient).information("Start in dedicated client mode");
    6262
     63    //! @cmdarg
     64    SetCommandLineArgument(generateDoc, "Internal.dox")
     65        .information("Generates a Doxygen file from things like SetConsoleCommand");
     66
    6367    /**
    6468    @brief
     
    6973        Game* game = new Game(strCmdLine);
    7074
    71         game->setStateHierarchy(
    72         "root"
    73         " graphics"
    74         "  mainMenu"
    75         "  standalone,server,client"
    76         "   level"
    77         " server,client"
    78         "  level"
    79         );
    80 
    81         game->requestState("root");
    82 
    83         // Some development hacks (not really, but in the future, this calls won't make sense anymore)
    84         if (CommandLineParser::getValue("standalone").getBool())
    85             Game::getInstance().requestStates("graphics, standalone, level");
    86         else if (CommandLineParser::getValue("server").getBool())
    87             Game::getInstance().requestStates("graphics, server, level");
    88         else if (CommandLineParser::getValue("client").getBool())
    89             Game::getInstance().requestStates("graphics, client, level");
    90         else if (CommandLineParser::getValue("dedicated").getBool())
    91             Game::getInstance().requestStates("server, level");
    92         else if (CommandLineParser::getValue("dedicatedClient").getBool())
    93             Game::getInstance().requestStates("client, level");
     75        if (CommandLineParser::existsArgument("generateDoc"))
     76        {
     77            // Generate additional documentation written to ONE file
     78            std::string filename;
     79            CommandLineParser::getValue("generateDoc", &filename);
     80        }
    9481        else
    9582        {
    96             if (!CommandLineParser::getValue("console").getBool())
    97                 Game::getInstance().requestStates("graphics, mainMenu");
     83            game->setStateHierarchy(
     84            "root"
     85            " graphics"
     86            "  mainMenu"
     87            "  standalone,server,client"
     88            "   level"
     89            " server,client"
     90            "  level"
     91            );
     92
     93            game->requestState("root");
     94
     95            // Some development hacks (not really, but in the future, this calls won't make sense anymore)
     96            if (CommandLineParser::getValue("standalone").getBool())
     97                Game::getInstance().requestStates("graphics, standalone, level");
     98            else if (CommandLineParser::getValue("server").getBool())
     99                Game::getInstance().requestStates("graphics, server, level");
     100            else if (CommandLineParser::getValue("client").getBool())
     101                Game::getInstance().requestStates("graphics, client, level");
     102            else if (CommandLineParser::getValue("dedicated").getBool())
     103                Game::getInstance().requestStates("server, level");
     104            else if (CommandLineParser::getValue("dedicatedClient").getBool())
     105                Game::getInstance().requestStates("client, level");
     106            else
     107            {
     108                if (!CommandLineParser::getValue("console").getBool())
     109                    Game::getInstance().requestStates("graphics, mainMenu");
     110            }
     111
     112            game->run();
    98113        }
    99114
    100         game->run();
    101115        delete game;
    102116
Note: See TracChangeset for help on using the changeset viewer.