[Orxonox-commit 3579] r8264 - in code/trunk/cmake: . tools

rgrieder at orxonox.net rgrieder at orxonox.net
Tue Apr 19 06:00:12 CEST 2011


Author: rgrieder
Date: 2011-04-19 06:00:12 +0200 (Tue, 19 Apr 2011)
New Revision: 8264

Modified:
   code/trunk/cmake/LibraryConfig.cmake
   code/trunk/cmake/tools/CheckOGREPlugins.cmake
Log:
Removed build option "OGRE_PLUGINS" since it's not very useful.
Instead created two categories of plugins: mandatory and optional ones, see bottom of LibraryConfig.cmake.

Modified: code/trunk/cmake/LibraryConfig.cmake
===================================================================
--- code/trunk/cmake/LibraryConfig.cmake	2011-04-18 21:51:18 UTC (rev 8263)
+++ code/trunk/cmake/LibraryConfig.cmake	2011-04-19 04:00:12 UTC (rev 8264)
@@ -201,17 +201,11 @@
 
 ################# OGRE Plugins ##################
 
-# More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager
-SET(OGRE_PLUGINS_INT Plugin_ParticleFX)
-IF(WIN32)
-  # CG program manager is probably DirectX related (not available under unix)
-  LIST(APPEND OGRE_PLUGINS_INT Plugin_CgProgramManager)
-ENDIF(WIN32)
-SET(OGRE_PLUGINS ${OGRE_PLUGINS_INT} CACHE STRING
-   "Specify which OGRE plugins to load. Existance check is performed.")
-
 # Check the plugins and determine the plugin folder
 # You can give a hint by setting the environment variable ENV{OGRE_PLUGIN_DIR}
 INCLUDE(CheckOGREPlugins)
-CHECK_OGRE_PLUGINS(${OGRE_PLUGINS})
+# Note 1: First argument (as string!) are for mandatory plugins, second one is
+#         for optional ones.
+# Note 2: Render systems are found automatically (at least one required)
+CHECK_OGRE_PLUGINS("Plugin_ParticleFX" "Plugin_CgProgramManager")
 

Modified: code/trunk/cmake/tools/CheckOGREPlugins.cmake
===================================================================
--- code/trunk/cmake/tools/CheckOGREPlugins.cmake	2011-04-18 21:51:18 UTC (rev 8263)
+++ code/trunk/cmake/tools/CheckOGREPlugins.cmake	2011-04-19 04:00:12 UTC (rev 8264)
@@ -20,25 +20,24 @@
  #  Author:
  #    Reto Grieder
  #  Description:
- #    Function that checks each OGRE plugin for existance. Also looks for debug
- #    versions and sets them accordingly.
- #    All the plugins specified as function arguments have to be found or the
- #    script will issue a fatal error. Additionally, all release plugins have
- #    to be found in the same folder. Analogously for debug plugins.
+ #    Finds OGRE plugins and their folder, which has to be unique each set
+ #    of plugins (Debug, Release).
+ #    Specify arguments as strings: mandatory and optional plugins.
+ #    Input:
+ #      _mandatory_plugins Have to be found, error issued otherwise
+ #      _optional_plugins  Added as well if found
  #    Output:
- #    OGRE_PLUGINS_FOLDER_DEBUG   Folder with the debug plugins
- #    OGRE_PLUGINS_FOLDER_RELEASE Folder with the release plugins
- #    OGRE_PLUGINS_DEBUG          Names of the debug plugins without extension
- #    OGRE_PLUGINS_RELEASE        Names of the release plugins without ext.
+ #      OGRE_PLUGINS_FOLDER_DEBUG   Folder with the debug plugins
+ #      OGRE_PLUGINS_FOLDER_RELEASE Folder with the release plugins
+ #      OGRE_PLUGINS_DEBUG          Names of the debug plugins without extension
+ #      OGRE_PLUGINS_RELEASE        Names of the release plugins without ext.
  #  Note:
  #    You must not specify render systems as input. That will be taken care of
  #    automatically.
  #
 
-FUNCTION(CHECK_OGRE_PLUGINS)
+FUNCTION(CHECK_OGRE_PLUGINS _mandatory_plugins _optional_plugins)
 
-  SET(OGRE_PLUGINS ${ARGN})
-
   IF(WIN32)
     # On Windows we need only *.dll, not *.lib. Especially the MSVC generator doesn't look for *.dll
     SET(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
@@ -48,7 +47,7 @@
 
   SET(OGRE_RENDER_SYSTEMS RenderSystem_GL RenderSystem_Direct3D9)
   SET(OGRE_RENDER_SYSTEM_FOUND FALSE)
-  FOREACH(_plugin ${OGRE_PLUGINS} ${OGRE_RENDER_SYSTEMS})
+  FOREACH(_plugin ${_mandatory_plugins} ${_optional_plugins} ${OGRE_RENDER_SYSTEMS})
     FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_OPTIMIZED
       NAMES ${_plugin}
       PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
@@ -61,7 +60,7 @@
     )
     # We only need at least one render system. Check at the end.
     IF(NOT ${_plugin} MATCHES "RenderSystem")
-      IF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED)
+      IF(${_plugin} MATCHES "${_mandatory_plugins}" AND NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED)
         MESSAGE(FATAL_ERROR "Could not find OGRE plugin named ${_plugin}")
       ENDIF()
     ELSEIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)




More information about the Orxonox-commit mailing list