[Orxonox-commit 2641] r7346 - in code/branches/doc: doc/api src/orxonox

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Sep 4 01:10:44 CEST 2010


Author: rgrieder
Date: 2010-09-04 01:10:43 +0200 (Sat, 04 Sep 2010)
New Revision: 7346

Modified:
   code/branches/doc/doc/api/CMakeLists.txt
   code/branches/doc/doc/api/doxy.config.in
   code/branches/doc/src/orxonox/Main.cc
Log:
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.


Modified: code/branches/doc/doc/api/CMakeLists.txt
===================================================================
--- code/branches/doc/doc/api/CMakeLists.txt	2010-09-03 22:50:25 UTC (rev 7345)
+++ code/branches/doc/doc/api/CMakeLists.txt	2010-09-03 23:10:43 UTC (rev 7346)
@@ -45,6 +45,21 @@
   #  MESSAGE(STATUS "dvips command DVIPS_CONVERTER not found but usually required.")
   #ENDIF (NOT DVIPS_CONVERTER)
 
+  SET(INTERNAL_DOCFILE ${CMAKE_CURRENT_BINARY_DIR}/Internal.dox)
+  IF(WIN32)
+    SET(_working_dir ${RUNTIME_LIBRARY_DIRECTORY})
+  ELSE()
+    SET(_working_dir ${CMAKE_CURRENT_BINARY_DIR})
+  ENDIF()
+  ADD_CUSTOM_COMMAND(
+    OUTPUT ${INTERNAL_DOCFILE}
+    COMMAND orxonox-main
+    ARGS --noIOConsole --generateDoc ${INTERNAL_DOCFILE}
+    WORKING_DIRECTORY ${_working_dir}
+    COMMENT "Generating additional Doxygen documentation from Orxonox executable"
+  )
+  ADD_CUSTOM_TARGET(doc_internal DEPENDS ${INTERNAL_DOCFILE})
+
   IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in)
     # use (configured) doxy.config from (out of place) BUILD tree:
     SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/doxy.config)

Modified: code/branches/doc/doc/api/doxy.config.in
===================================================================
--- code/branches/doc/doc/api/doxy.config.in	2010-09-03 22:50:25 UTC (rev 7345)
+++ code/branches/doc/doc/api/doxy.config.in	2010-09-03 23:10:43 UTC (rev 7346)
@@ -588,7 +588,8 @@
 INPUT                  = @CMAKE_SOURCE_DIR@/src \
                          @CMAKE_CURRENT_SOURCE_DIR@ \
                          @CMAKE_BINARY_DIR@/src/OrxonoxConfig.h \
-                         @CMAKE_BINARY_DIR@/src/SpecialConfig.h
+                         @CMAKE_BINARY_DIR@/src/SpecialConfig.h \
+                         @INTERNAL_DOCFILE@
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is

Modified: code/branches/doc/src/orxonox/Main.cc
===================================================================
--- code/branches/doc/src/orxonox/Main.cc	2010-09-03 22:50:25 UTC (rev 7345)
+++ code/branches/doc/src/orxonox/Main.cc	2010-09-03 23:10:43 UTC (rev 7346)
@@ -60,6 +60,10 @@
     //! @cmdarg
     SetCommandLineSwitch(dedicatedClient).information("Start in dedicated client mode");
 
+    //! @cmdarg
+    SetCommandLineArgument(generateDoc, "Internal.dox")
+        .information("Generates a Doxygen file from things like SetConsoleCommand");
+
     /**
     @brief
         Starting point of orxonox (however not the entry point of the program!)
@@ -68,36 +72,46 @@
     {
         Game* game = new Game(strCmdLine);
 
-        game->setStateHierarchy(
-        "root"
-        " graphics"
-        "  mainMenu"
-        "  standalone,server,client"
-        "   level"
-        " server,client"
-        "  level"
-        );
+        if (CommandLineParser::existsArgument("generateDoc"))
+        {
+            // Generate additional documentation written to ONE file
+            std::string filename;
+            CommandLineParser::getValue("generateDoc", &filename);
+        }
+        else
+        {
+            game->setStateHierarchy(
+            "root"
+            " graphics"
+            "  mainMenu"
+            "  standalone,server,client"
+            "   level"
+            " server,client"
+            "  level"
+            );
 
-        game->requestState("root");
+            game->requestState("root");
 
-        // Some development hacks (not really, but in the future, this calls won't make sense anymore)
-        if (CommandLineParser::getValue("standalone").getBool())
-            Game::getInstance().requestStates("graphics, standalone, level");
-        else if (CommandLineParser::getValue("server").getBool())
-            Game::getInstance().requestStates("graphics, server, level");
-        else if (CommandLineParser::getValue("client").getBool())
-            Game::getInstance().requestStates("graphics, client, level");
-        else if (CommandLineParser::getValue("dedicated").getBool())
-            Game::getInstance().requestStates("server, level");
-        else if (CommandLineParser::getValue("dedicatedClient").getBool())
-            Game::getInstance().requestStates("client, level");
-        else
-        {
-            if (!CommandLineParser::getValue("console").getBool())
-                Game::getInstance().requestStates("graphics, mainMenu");
+            // Some development hacks (not really, but in the future, this calls won't make sense anymore)
+            if (CommandLineParser::getValue("standalone").getBool())
+                Game::getInstance().requestStates("graphics, standalone, level");
+            else if (CommandLineParser::getValue("server").getBool())
+                Game::getInstance().requestStates("graphics, server, level");
+            else if (CommandLineParser::getValue("client").getBool())
+                Game::getInstance().requestStates("graphics, client, level");
+            else if (CommandLineParser::getValue("dedicated").getBool())
+                Game::getInstance().requestStates("server, level");
+            else if (CommandLineParser::getValue("dedicatedClient").getBool())
+                Game::getInstance().requestStates("client, level");
+            else
+            {
+                if (!CommandLineParser::getValue("console").getBool())
+                    Game::getInstance().requestStates("graphics, mainMenu");
+            }
+
+            game->run();
         }
 
-        game->run();
         delete game;
 
         return 0;




More information about the Orxonox-commit mailing list