[Orxonox-commit 3379] r8066 - in code/branches/kicklib: cmake src/libraries/core src/libraries/core/command

landauf at orxonox.net landauf at orxonox.net
Sat Mar 12 23:54:35 CET 2011


Author: landauf
Date: 2011-03-12 23:54:35 +0100 (Sat, 12 Mar 2011)
New Revision: 8066

Modified:
   code/branches/kicklib/cmake/LibraryConfig.cmake
   code/branches/kicklib/src/libraries/core/CorePrereqs.h
   code/branches/kicklib/src/libraries/core/GraphicsManager.cc
   code/branches/kicklib/src/libraries/core/PathConfig.cc
   code/branches/kicklib/src/libraries/core/command/ArgumentCompletionFunctions.cc
Log:
added support for boost 1.46 and adjusted code to work with the 3rd version of boost::filesystem

Modified: code/branches/kicklib/cmake/LibraryConfig.cmake
===================================================================
--- code/branches/kicklib/cmake/LibraryConfig.cmake	2011-03-12 22:08:06 UTC (rev 8065)
+++ code/branches/kicklib/cmake/LibraryConfig.cmake	2011-03-12 22:54:35 UTC (rev 8066)
@@ -142,9 +142,10 @@
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH)
 
 ##### Boost #####
-# Expand the next statement if newer boost versions than 1.36.1 are released
+# Expand the next statement if newer boost versions are released
 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 1.38 1.38.0 1.39 1.39.0 1.40 1.40.0
-                              1.41 1.41.0 1.42 1.42.0 1.43 1.43.0 1.44 1.44.0)
+                              1.41 1.41.0 1.42 1.42.0 1.43 1.43.0 1.44 1.44.0
+                              1.45 1.45.0 1.46 1.46.0 1.46.1)
 IF( NOT TARDIS )
   FIND_PACKAGE(Boost 1.35 REQUIRED thread filesystem system date_time)
 ENDIF()

Modified: code/branches/kicklib/src/libraries/core/CorePrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/core/CorePrereqs.h	2011-03-12 22:08:06 UTC (rev 8065)
+++ code/branches/kicklib/src/libraries/core/CorePrereqs.h	2011-03-12 22:54:35 UTC (rev 8066)
@@ -257,14 +257,14 @@
 // Boost
 namespace boost
 {
-#if (BOOST_VERSION < 104400)
+#if BOOST_VERSION < 104400
     namespace filesystem
     {
         struct path_traits;
         template <class String, class Traits> class basic_path;
         typedef basic_path<std::string, path_traits> path;
     }
-#else
+#elif BOOST_VERSION < 104600
     namespace filesystem2
     {
         struct path_traits;
@@ -277,6 +277,15 @@
         using filesystem2::path_traits;
         using filesystem2::path;
     }
+#else
+    namespace filesystem3
+    {
+        class path;
+    }
+    namespace filesystem
+    {
+        using filesystem3::path;
+    }
 #endif
     class thread;
     class mutex;

Modified: code/branches/kicklib/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GraphicsManager.cc	2011-03-12 22:08:06 UTC (rev 8065)
+++ code/branches/kicklib/src/libraries/core/GraphicsManager.cc	2011-03-12 22:54:35 UTC (rev 8066)
@@ -242,7 +242,11 @@
         SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0');
         // Use backslash paths on Windows! file_string() already does that though.
         for (unsigned int i = 0; i < plugins.size(); ++i)
+#if BOOST_FILESYSTEM_VERSION < 3
             ogreRoot_->loadPlugin((folder / plugins[i]).file_string());
+#else
+            ogreRoot_->loadPlugin((folder / plugins[i]).string());
+#endif
     }
 
     void GraphicsManager::loadRenderer()

Modified: code/branches/kicklib/src/libraries/core/PathConfig.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/PathConfig.cc	2011-03-12 22:08:06 UTC (rev 8065)
+++ code/branches/kicklib/src/libraries/core/PathConfig.cc	2011-03-12 22:54:35 UTC (rev 8066)
@@ -58,8 +58,10 @@
 // Boost 1.36 has some issues with deprecated functions that have been omitted
 #if (BOOST_VERSION == 103600)
 #  define BOOST_LEAF_FUNCTION filename
+#elif (BOOST_FILESYSTEM_VERSION < 3)
+#  define BOOST_LEAF_FUNCTION leaf
 #else
-#  define BOOST_LEAF_FUNCTION leaf
+#  define BOOST_LEAF_FUNCTION path().filename().string
 #endif
 
 namespace orxonox
@@ -281,7 +283,11 @@
                 {
                     // We've found a helper file
                     const std::string& library = filename.substr(0, filename.size() - moduleextensionlength);
+#if BOOST_FILESYSTEM_VERSION < 3
                     modulePaths.push_back((modulePath_ / library).file_string());
+#else
+                    modulePaths.push_back((modulePath_ / library).string());
+#endif
                 }
             }
             ++file;

Modified: code/branches/kicklib/src/libraries/core/command/ArgumentCompletionFunctions.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/command/ArgumentCompletionFunctions.cc	2011-03-12 22:08:06 UTC (rev 8065)
+++ code/branches/kicklib/src/libraries/core/command/ArgumentCompletionFunctions.cc	2011-03-12 22:54:35 UTC (rev 8066)
@@ -49,8 +49,13 @@
 // Boost 1.36 has some issues with deprecated functions that have been omitted
 #if (BOOST_VERSION == 103600)
 #  define BOOST_LEAF_FUNCTION filename
+#  define BOOST_DICTIONARY_ENTRY_NAME string
+#elif (BOOST_FILESYSTEM_VERSION < 3)
+#  define BOOST_LEAF_FUNCTION leaf
+#  define BOOST_DICTIONARY_ENTRY_NAME string
 #else
-#  define BOOST_LEAF_FUNCTION leaf
+#  define BOOST_LEAF_FUNCTION path().filename().string
+#  define BOOST_DICTIONARY_ENTRY_NAME path().string
 #endif
 
 namespace orxonox
@@ -256,9 +261,9 @@
                 while (file != end)
                 {
                     if (boost::filesystem::is_directory(*file))
-                        dirlist.push_back(ArgumentCompletionListElement(file->string() + '/', getLowercase(file->string()) + '/', file->BOOST_LEAF_FUNCTION() + '/'));
+                        dirlist.push_back(ArgumentCompletionListElement(file->BOOST_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BOOST_DICTIONARY_ENTRY_NAME()) + '/', file->BOOST_LEAF_FUNCTION() + '/'));
                     else
-                        filelist.push_back(ArgumentCompletionListElement(file->string(), getLowercase(file->string()), file->BOOST_LEAF_FUNCTION()));
+                        filelist.push_back(ArgumentCompletionListElement(file->BOOST_DICTIONARY_ENTRY_NAME(), getLowercase(file->BOOST_DICTIONARY_ENTRY_NAME()), file->BOOST_LEAF_FUNCTION()));
                     ++file;
                 }
             }




More information about the Orxonox-commit mailing list