Commits

Shankar Giri committed ebd9b2c

Second set of patches to complete the fixes for Mac OS X builds.

Comments (0)

Files changed (6)

CMakeModules/FindOGRE.cmake

 # Once done, this will define
 #
 #  OGRE_FOUND - system has OGRE
-#  OGRE_INCLUDE_DIRS - the OGRE include directories
+#  OGRE_INCLUDE_DIRS - the OGRE include directories 
 #  OGRE_LIBRARIES - link these to use the OGRE core
+#  OGRE_BINARY_REL - location of the main Ogre binary (win32 non-static only, release)
+#  OGRE_BINARY_DBG - location of the main Ogre binaries (win32 non-static only, debug)
 #
 # Additionally this script searches for the following optional
 # parts of the Ogre package:
 #  Plugin_BSPSceneManager, Plugin_CgProgramManager,
 #  Plugin_OctreeSceneManager, Plugin_OctreeZone,
 #  Plugin_ParticleFX, Plugin_PCZSceneManager,
-#  RenderSystem_GL, RenderSystem_Direct3D9, RenderSystem_Direct3D10,
-#  CEGUIRenderer, Paging, Terrain
+#  RenderSystem_GL, RenderSystem_Direct3D9,
+#  Paging, Terrain
 #
 # For each of these components, the following variables are defined:
 #
 #  OGRE_${COMPONENT}_FOUND - ${COMPONENT} is available
 #  OGRE_${COMPONENT}_INCLUDE_DIRS - additional include directories for ${COMPONENT}
-#  OGRE_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT}
+#  OGRE_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT} 
+#  OGRE_${COMPONENT}_BINARY_REL - location of the component binary (win32 non-static only, release)
+#  OGRE_${COMPONENT}_BINARY_DBG - location of the component binary (win32 non-static only, debug)
 #
 # Finally, the following variables are defined:
 #
 
 
 # Get path, convert backslashes as ${ENV_${var}}
-getenv_path(OGRE_BYATIS)
-#getenv_path(OGRE_HOME)
-#getenv_path(OGRE_SDK)
+getenv_path(OGRE_HOME)
+getenv_path(OGRE_SDK)
 getenv_path(OGRE_SOURCE)
 getenv_path(OGRE_BUILD)
-#getenv_path(PROGRAMFILES)
-
+getenv_path(OGRE_DEPENDENCIES_DIR)
+getenv_path(PROGRAMFILES)
 
 # Determine whether to search for a dynamic or static build
 if (OGRE_STATIC)
 
 
 if(APPLE)
-    set(OGRE_LIBRARY_NAMES "Ogre${OGRE_LIB_SUFFIX}")
-else(APPLE)
+	set(OGRE_LIBRARY_NAMES "Ogre${OGRE_LIB_SUFFIX}")
+else()
     set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}")
-endif(APPLE)
+endif()
 get_debug_names(OGRE_LIBRARY_NAMES)
 
 # construct search paths from environmental hints and
 # OS specific guesses
-if (UNIX)
+if (WIN32)
+  set(OGRE_PREFIX_GUESSES
+    ${ENV_PROGRAMFILES}/OGRE
+    C:/OgreSDK
+  )
+elseif (UNIX)
   set(OGRE_PREFIX_GUESSES
     /opt/ogre
     /opt/OGRE
-    /usr/lib/ogre
-    /usr/lib/OGRE
-    /usr/local/lib/ogre
-    /usr/local/lib/OGRE
+    /usr/lib${LIB_SUFFIX}/ogre
+    /usr/lib${LIB_SUFFIX}/OGRE
+    /usr/local/lib${LIB_SUFFIX}/ogre
+    /usr/local/lib${LIB_SUFFIX}/OGRE
     $ENV{HOME}/ogre
     $ENV{HOME}/OGRE
   )
 endif ()
-
-#set(OGRE_PREFIX_PATH
-#  ${OGRE_HOME} ${ENV_OGRE_HOME} ${ENV_OGRE_SDK}
-#  ${OGRE_PREFIX_GUESSES}
-#)
-
 set(OGRE_PREFIX_PATH
-  ${ENV_OGRE_BYATIS}
+  ${OGRE_HOME} ${OGRE_SDK} ${ENV_OGRE_HOME} ${ENV_OGRE_SDK}
   ${OGRE_PREFIX_GUESSES}
 )
 create_search_paths(OGRE)
 # If both OGRE_BUILD and OGRE_SOURCE are set, prepare to find Ogre in a build dir
 set(OGRE_PREFIX_SOURCE ${OGRE_SOURCE} ${ENV_OGRE_SOURCE})
 set(OGRE_PREFIX_BUILD ${OGRE_BUILD} ${ENV_OGRE_BUILD})
+set(OGRE_PREFIX_DEPENDENCIES_DIR ${OGRE_DEPENDENCIES_DIR} ${ENV_OGRE_DEPENDENCIES_DIR})
 if (OGRE_PREFIX_SOURCE AND OGRE_PREFIX_BUILD)
   foreach(dir ${OGRE_PREFIX_SOURCE})
-    set(OGRE_INC_SEARCH_PATH ${dir}/OgreMain/include ${dir}/Dependencies/include ${OGRE_INC_SEARCH_PATH})
-    set(OGRE_LIB_SEARCH_PATH ${dir}/lib ${dir}/Dependencies/lib ${OGRE_LIB_SEARCH_PATH})
+    set(OGRE_INC_SEARCH_PATH ${dir}/OgreMain/include ${dir}/Dependencies/include ${dir}/iOSDependencies/include ${OGRE_INC_SEARCH_PATH})
+    set(OGRE_LIB_SEARCH_PATH ${dir}/lib ${dir}/Dependencies/lib ${dir}/iOSDependencies/lib ${OGRE_LIB_SEARCH_PATH})
+    set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
   endforeach(dir)
   foreach(dir ${OGRE_PREFIX_BUILD})
     set(OGRE_INC_SEARCH_PATH ${dir}/include ${OGRE_INC_SEARCH_PATH})
     set(OGRE_LIB_SEARCH_PATH ${dir}/lib ${OGRE_LIB_SEARCH_PATH})
+    set(OGRE_BIN_SEARCH_PATH ${dir}/bin ${OGRE_BIN_SEARCH_PATH})
+	set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
   endforeach(dir)
+  
+  if (OGRE_PREFIX_DEPENDENCIES_DIR)
+    set(OGRE_INC_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/include ${OGRE_INC_SEARCH_PATH})
+    set(OGRE_LIB_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/lib ${OGRE_LIB_SEARCH_PATH})
+    set(OGRE_BIN_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/bin ${OGRE_BIN_SEARCH_PATH})
+  endif()
 else()
   set(OGRE_PREFIX_SOURCE "NOTFOUND")
   set(OGRE_PREFIX_BUILD "NOTFOUND")
 endif ()
 
 # redo search if any of the environmental hints changed
-set(OGRE_COMPONENTS Paging Terrain
+set(OGRE_COMPONENTS Paging Terrain 
   Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager
   Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX
-  RenderSystem_Direct3D10 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GLES)
-set(OGRE_RESET_VARS
-  OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR
+  RenderSystem_Direct3D11 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GLES RenderSystem_GLES2)
+set(OGRE_RESET_VARS 
+  OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR 
   OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG
   OGRE_PLUGIN_DIR_DBG OGRE_PLUGIN_DIR_REL OGRE_MEDIA_DIR)
 foreach (comp ${OGRE_COMPONENTS})
 
 # try to locate Ogre via pkg-config
 use_pkgconfig(OGRE_PKGC "OGRE${OGRE_LIB_SUFFIX}")
-# try to find framework on OSX
-findpkg_framework(OGRE)
+
+if(NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
+  # try to find framework on OSX
+  findpkg_framework(OGRE)
+else()
+	set(OGRE_LIBRARY_FWK "")
+endif()
 
 # locate Ogre include files
-find_path(OGRE_CONFIG_INCLUDE_DIR NAMES OgreConfig.h HINTS ${OGRE_INC_SEARCH_PATH} ${OGRE_FRAMEWORK_INCLUDES} ${OGRE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES "OGRE")
+find_path(OGRE_CONFIG_INCLUDE_DIR NAMES OgreBuildSettings.h HINTS ${OGRE_INC_SEARCH_PATH} ${OGRE_FRAMEWORK_INCLUDES} ${OGRE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES "OGRE")
 find_path(OGRE_INCLUDE_DIR NAMES OgreRoot.h HINTS ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INC_SEARCH_PATH} ${OGRE_FRAMEWORK_INCLUDES} ${OGRE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES "OGRE")
 set(OGRE_INCOMPATIBLE FALSE)
 
-if (OGRE_INCLUDE_DIR AND OGRE_CONFIG_INCLUDE_DIR)
+if (OGRE_INCLUDE_DIR)
+  if (NOT OGRE_CONFIG_INCLUDE_DIR)
+    set(OGRE_CONFIG_INCLUDE_DIR ${OGRE_INCLUDE_DIR})
+  endif ()
   # determine Ogre version
   file(READ ${OGRE_INCLUDE_DIR}/OgrePrerequisites.h OGRE_TEMP_VERSION_CONTENT)
   get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_MAJOR OGRE_VERSION_MAJOR)
 
   # determine configuration settings
   set(OGRE_CONFIG_HEADERS
-    ${OGRE_CONFIG_INCLUDE_DIR}/buildsettings.h
-    ${OGRE_CONFIG_INCLUDE_DIR}/config.h
+    ${OGRE_CONFIG_INCLUDE_DIR}/OgreBuildSettings.h
     ${OGRE_CONFIG_INCLUDE_DIR}/OgreConfig.h
   )
   foreach(CFG_FILE ${OGRE_CONFIG_HEADERS})
     file(READ ${OGRE_CONFIG_HEADER} OGRE_TEMP_CONFIG_CONTENT)
     has_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_STATIC_LIB OGRE_CONFIG_STATIC)
     get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_THREAD_SUPPORT OGRE_CONFIG_THREADS)
+    get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_THREAD_PROVIDER OGRE_CONFIG_THREAD_PROVIDER)
     get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_NO_FREEIMAGE OGRE_CONFIG_FREEIMAGE)
     if (OGRE_CONFIG_STATIC AND OGRE_STATIC)
     elseif (OGRE_CONFIG_STATIC OR OGRE_STATIC)
 make_library_set(OGRE_LIBRARY)
 
 if(APPLE)
-set(OGRE_LIBRARY_DBG ${OGRE_LIB_SEARCH_PATH})
+  set(OGRE_LIBRARY_DBG ${OGRE_LIB_SEARCH_PATH})
 endif()
 if (OGRE_INCOMPATIBLE)
   set(OGRE_LIBRARY "NOTFOUND")
 list(REMOVE_DUPLICATES OGRE_INCLUDE_DIR)
 findpkg_finish(OGRE)
 add_parent_dir(OGRE_INCLUDE_DIRS OGRE_INCLUDE_DIR)
+if (OGRE_SOURCE)
+	# If working from source rather than SDK, add samples include
+	set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} "${OGRE_SOURCE}/Samples/Common/include")
+endif()
 
 mark_as_advanced(OGRE_CONFIG_INCLUDE_DIR OGRE_MEDIA_DIR OGRE_PLUGIN_DIR_REL OGRE_PLUGIN_DIR_DBG)
 
   find_package(Freetype QUIET)
   find_package(OpenGL QUIET)
   find_package(OpenGLES QUIET)
+  find_package(OpenGLES2 QUIET)
   find_package(ZLIB QUIET)
   find_package(ZZip QUIET)
   if (UNIX AND NOT APPLE)
       set(X11_FOUND FALSE)
     endif ()
   endif ()
-  if (APPLE)
+  if (APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
     find_package(Cocoa QUIET)
-    if (NOT Cocoa_FOUND)
+    find_package(CoreVideo QUIET)
+    if (NOT Cocoa_FOUND OR NOT CoreVideo_FOUND)
+      set(OGRE_DEPS_FOUND FALSE)
+    endif ()
+  endif ()
+  if (APPLE AND OGRE_BUILD_PLATFORM_APPLE_IOS)
+    find_package(iOSSDK QUIET)
+    if (NOT iOSSDK_FOUND)
       set(OGRE_DEPS_FOUND FALSE)
     endif ()
   endif ()
 
+  set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES} ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES} )
 
-  set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
-    ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
-    ${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB}
-    ${Cocoa_LIBRARIES})
-
+  if (APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
+    set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${Cocoa_LIBRARIES})
+  endif()
+  
   if (NOT ZLIB_FOUND OR NOT ZZip_FOUND)
     set(OGRE_DEPS_FOUND FALSE)
   endif ()
   endif ()
 
   if (OGRE_CONFIG_THREADS)
-    find_package(Boost COMPONENTS thread QUIET)
-    if (NOT Boost_THREAD_FOUND)
-      set(OGRE_DEPS_FOUND FALSE)
+    if (OGRE_CONFIG_THREAD_PROVIDER EQUAL 1)
+      find_package(Boost COMPONENTS thread QUIET)
+      if (NOT Boost_THREAD_FOUND)
+        set(OGRE_DEPS_FOUND FALSE)
+      else ()
+        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${Boost_LIBRARIES})
+        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
+      endif ()
+    elseif (OGRE_CONFIG_THREAD_PROVIDER EQUAL 2)
+      find_package(POCO QUIET)
+      if (NOT POCO_FOUND)
+        set(OGRE_DEPS_FOUND FALSE)
+      else ()
+        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${POCO_LIBRARIES})
+        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${POCO_INCLUDE_DIRS})
+      endif ()
+    elseif (OGRE_CONFIG_THREAD_PROVIDER EQUAL 3)
+      find_package(TBB QUIET)
+      if (NOT TBB_FOUND)
+        set(OGRE_DEPS_FOUND FALSE)
+      else ()
+        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${TBB_LIBRARIES})
+        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS})
+      endif ()
     endif ()
   endif ()
-
+  
   if (NOT OGRE_DEPS_FOUND)
     pkg_message(OGRE "Could not find all required dependencies for the Ogre package.")
     set(OGRE_FOUND FALSE)
 get_filename_component(OGRE_LIBRARY_DIR_DBG "${OGRE_LIBRARY_DBG}" PATH)
 set(OGRE_LIBRARY_DIRS ${OGRE_LIBRARY_DIR_REL} ${OGRE_LIBRARY_DIR_DBG})
 
+# find binaries
+if (NOT OGRE_STATIC)
+	if (WIN32)
+		find_file(OGRE_BINARY_REL NAMES "OgreMain.dll" HINTS ${OGRE_BIN_SEARCH_PATH}
+          PATH_SUFFIXES "" release relwithdebinfo minsizerel)
+		find_file(OGRE_BINARY_DBG NAMES "OgreMain_d.dll" HINTS ${OGRE_BIN_SEARCH_PATH}
+          PATH_SUFFIXES "" debug )
+	endif()
+	mark_as_advanced(OGRE_BINARY_REL OGRE_BINARY_DBG)
+endif()
+
+
+#########################################################
+# Find Ogre components
+#########################################################
+
+set(OGRE_COMPONENT_SEARCH_PATH_REL 
+  ${OGRE_LIBRARY_DIR_REL}/..
+  ${OGRE_LIBRARY_DIR_REL}/../..
+  ${OGRE_BIN_SEARCH_PATH}
+)
+set(OGRE_COMPONENT_SEARCH_PATH_DBG
+  ${OGRE_LIBRARY_DIR_DBG}/..
+  ${OGRE_LIBRARY_DIR_DBG}/../..
+  ${OGRE_BIN_SEARCH_PATH}
+)
+
+macro(ogre_find_component COMPONENT HEADER)
+  findpkg_begin(OGRE_${COMPONENT})
+  find_path(OGRE_${COMPONENT}_INCLUDE_DIR NAMES ${HEADER} HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES ${COMPONENT} OGRE/${COMPONENT} Components/${COMPONENT}/include)
+  set(OGRE_${COMPONENT}_LIBRARY_NAMES "Ogre${COMPONENT}${OGRE_LIB_SUFFIX}")
+  get_debug_names(OGRE_${COMPONENT}_LIBRARY_NAMES)
+  find_library(OGRE_${COMPONENT}_LIBRARY_REL NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
+  find_library(OGRE_${COMPONENT}_LIBRARY_DBG NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
+  make_library_set(OGRE_${COMPONENT}_LIBRARY)
+  findpkg_finish(OGRE_${COMPONENT})
+  if (OGRE_${COMPONENT}_FOUND)
+    # find binaries
+    if (NOT OGRE_STATIC)
+	  if (WIN32)
+	    find_file(OGRE_${COMPONENT}_BINARY_REL NAMES "Ogre${COMPONENT}.dll" HINTS ${OGRE_COMPONENT_SEARCH_PATH_REL} PATH_SUFFIXES "" bin bin/release bin/relwithdebinfo bin/minsizerel release)
+	    find_file(OGRE_${COMPONENT}_BINARY_DBG NAMES "Ogre${COMPONENT}_d.dll" HINTS ${OGRE_COMPONENT_SEARCH_PATH_DBG} PATH_SUFFIXES "" bin bin/debug debug)
+	  endif()
+	  mark_as_advanced(OGRE_${COMPONENT}_BINARY_REL OGRE_${COMPONENT}_BINARY_DBG)
+    endif()
+  endif()
+endmacro()
 
 # look for Paging component
-find_path(OGRE_Paging_INCLUDE_DIR NAMES OgrePage.h HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES Paging OGRE/Paging Components/Paging/include)
-set(OGRE_Paging_LIBRARY_NAMES "OgrePaging${OGRE_LIB_SUFFIX}")
-get_debug_names(OGRE_Paging_LIBRARY_NAMES)
-find_library(OGRE_Paging_LIBRARY_REL NAMES ${OGRE_Paging_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
-find_library(OGRE_Paging_LIBRARY_DBG NAMES ${OGRE_Paging_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
-#set(OGRE_Paging_LIBRARY_FWK ${OGRE_LIBRARY_FWK})
-make_library_set(OGRE_Paging_LIBRARY)
-if (OGRE_Paging_INCLUDE_DIR AND Ogre_Paging_LIBRARY)
-  set(OGRE_Paging_FOUND TRUE)
-  set(OGRE_Paging_INCLUDE_DIRS ${OGRE_Paging_INCLUDE_DIRS})
-  set(OGRE_Paging_LIBRARIES ${OGRE_Paging_LIBRARIES})
-endif ()
-mark_as_advanced(OGRE_Paging_INCLUDE_DIR OGRE_Paging_LIBRARY_REL OGRE_Paging_LIBRARY_DBG OGRE_Paging_LIBRARY_FWK)
+ogre_find_component(Paging OgrePaging.h)
+# look for Terrain component
+ogre_find_component(Terrain OgreTerrain.h)
+# look for Property component
+ogre_find_component(Property OgreProperty.h)
+# look for RTShaderSystem component
+ogre_find_component(RTShaderSystem OgreRTShaderSystem.h)
 
-# look for Terrain component
-find_path(OGRE_Terrain_INCLUDE_DIR NAMES OgreTerrain.h HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES Terrain OGRE/Terrain Components/Terrain/include)
-set(OGRE_Terrain_LIBRARY_NAMES "OgreTerrain${OGRE_LIB_SUFFIX}")
-get_debug_names(OGRE_Terrain_LIBRARY_NAMES)
-find_library(OGRE_Terrain_LIBRARY_REL NAMES ${OGRE_Terrain_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
-find_library(OGRE_Terrain_LIBRARY_DBG NAMES ${OGRE_Terrain_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
-#set(OGRE_Terrain_LIBRARY_FWK ${OGRE_LIBRARY_FWK})
-make_library_set(OGRE_Terrain_LIBRARY)
-if (OGRE_Terrain_INCLUDE_DIR AND Ogre_Terrain_LIBRARY)
-  set(OGRE_Terrain_FOUND TRUE)
-  set(OGRE_Terrain_INCLUDE_DIRS ${OGRE_Terrain_INCLUDE_DIRS})
-  set(OGRE_Terrain_LIBRARIES ${OGRE_Terrain_LIBRARIES})
-endif ()
-mark_as_advanced(OGRE_Terrain_INCLUDE_DIR OGRE_Terrain_LIBRARY_REL OGRE_Terrain_LIBRARY_DBG OGRE_Terrain_LIBRARY_FWK)
 
 #########################################################
 # Find Ogre plugins
     set(TMP_CMAKE_LIB_PREFIX ${CMAKE_FIND_LIBRARY_PREFIXES})
     set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "")
   endif()
-
+  
   # strip RenderSystem_ or Plugin_ prefix from plugin name
   string(REPLACE "RenderSystem_" "" PLUGIN_TEMP ${PLUGIN})
   string(REPLACE "Plugin_" "" PLUGIN_NAME ${PLUGIN_TEMP})
-
+  
   # header files for plugins are not usually needed, but find them anyway if they are present
   set(OGRE_PLUGIN_PATH_SUFFIXES
-    PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN}
+    PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN} 
     RenderSystems RenderSystems/${PLUGIN_NAME} ${ARGN})
-  find_path(OGRE_${PLUGIN}_INCLUDE_DIR NAMES ${HEADER}
-    HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE}
+  find_path(OGRE_${PLUGIN}_INCLUDE_DIR NAMES ${HEADER} 
+    HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE}  
     PATH_SUFFIXES ${OGRE_PLUGIN_PATH_SUFFIXES})
   # find link libraries for plugins
   set(OGRE_${PLUGIN}_LIBRARY_NAMES "${PLUGIN}${OGRE_LIB_SUFFIX}")
   if (OGRE_${PLUGIN}_FOUND)
     if (NOT OGRE_PLUGIN_DIR_REL OR NOT OGRE_PLUGIN_DIR_DBG)
       if (WIN32)
-        set(OGRE_PLUGIN_SEARCH_PATH_REL
+        set(OGRE_PLUGIN_SEARCH_PATH_REL 
           ${OGRE_LIBRARY_DIR_REL}/..
           ${OGRE_LIBRARY_DIR_REL}/../..
+		  ${OGRE_BIN_SEARCH_PATH}
         )
         set(OGRE_PLUGIN_SEARCH_PATH_DBG
           ${OGRE_LIBRARY_DIR_DBG}/..
           ${OGRE_LIBRARY_DIR_DBG}/../..
+		  ${OGRE_BIN_SEARCH_PATH}
         )
         find_path(OGRE_PLUGIN_DIR_REL NAMES "${PLUGIN}.dll" HINTS ${OGRE_PLUGIN_SEARCH_PATH_REL}
-          PATH_SUFFIXES "" bin bin/release bin/relwithdebinfo bin/minsizerel)
+          PATH_SUFFIXES "" bin bin/release bin/relwithdebinfo bin/minsizerel release)
         find_path(OGRE_PLUGIN_DIR_DBG NAMES "${PLUGIN}_d.dll" HINTS ${OGRE_PLUGIN_SEARCH_PATH_DBG}
-          PATH_SUFFIXES "" bin bin/debug)
+          PATH_SUFFIXES "" bin bin/debug debug)
       elseif (UNIX)
         get_filename_component(OGRE_PLUGIN_DIR_TMP ${OGRE_${PLUGIN}_LIBRARY_REL} PATH)
         set(OGRE_PLUGIN_DIR_REL ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (release)")
         set(OGRE_PLUGIN_DIR_DBG ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (debug)")
       endif ()
     endif ()
+	
+	# find binaries
+	if (NOT OGRE_STATIC)
+		if (WIN32)
+			find_file(OGRE_${PLUGIN}_REL NAMES "${PLUGIN}.dll" HINTS ${OGRE_PLUGIN_DIR_REL})
+			find_file(OGRE_${PLUGIN}_DBG NAMES "${PLUGIN}_d.dll" HINTS ${OGRE_PLUGIN_DIR_DBG})
+		endif()
+		mark_as_advanced(OGRE_${PLUGIN}_REL OGRE_${PLUGIN}_DBG)
+	endif()
+	
   endif ()
 
   if (TMP_CMAKE_LIB_PREFIX)
 ogre_find_plugin(Plugin_ParticleFX OgreParticleFXPrerequisites.h PlugIns/ParticleFX/include)
 ogre_find_plugin(RenderSystem_GL OgreGLRenderSystem.h RenderSystems/GL/include)
 ogre_find_plugin(RenderSystem_GLES OgreGLESRenderSystem.h RenderSystems/GLES/include)
+ogre_find_plugin(RenderSystem_GLES2 OgreGLES2RenderSystem.h RenderSystems/GLES2/include)
 ogre_find_plugin(RenderSystem_Direct3D9 OgreD3D9RenderSystem.h RenderSystems/Direct3D9/include)
-ogre_find_plugin(RenderSystem_Direct3D10 OgreD3D10RenderSystem.h RenderSystems/Direct3D10/include)
+ogre_find_plugin(RenderSystem_Direct3D11 OgreD3D11RenderSystem.h RenderSystems/Direct3D11/include)
 
 if (OGRE_STATIC)
   # check if dependencies for plugins are met
   if (NOT DirectX_FOUND)
     set(OGRE_RenderSystem_Direct3D9_FOUND FALSE)
   endif ()
-  if (NOT DirectX_D3D10_FOUND)
-    set(OGRE_RenderSystem_Direct3D10_FOUND FALSE)
+  if (NOT DirectX_D3D11_FOUND)
+    set(OGRE_RenderSystem_Direct3D11_FOUND FALSE)
   endif ()
   if (NOT OPENGL_FOUND)
     set(OGRE_RenderSystem_GL_FOUND FALSE)
   if (NOT OPENGLES_FOUND)
     set(OGRE_RenderSystem_GLES_FOUND FALSE)
   endif ()
+  if (NOT OPENGLES2_FOUND)
+    set(OGRE_RenderSystem_GLES2_FOUND FALSE)
+  endif ()
   if (NOT Cg_FOUND)
     set(OGRE_Plugin_CgProgramManager_FOUND FALSE)
   endif ()
-
+  
   set(OGRE_RenderSystem_Direct3D9_LIBRARIES ${OGRE_RenderSystem_Direct3D9_LIBRARIES}
     ${DirectX_LIBRARIES}
   )
-  set(OGRE_RenderSystem_Direct3D10_LIBRARIES ${OGRE_RenderSystem_Direct3D10_LIBRARIES}
-    ${DirectX_D3D10_LIBRARIES}
+
+  set(OGRE_RenderSystem_Direct3D11_LIBRARIES ${OGRE_RenderSystem_Direct3D11_LIBRARIES}
+    ${DirectX_D3D11_LIBRARIES}
   )
   set(OGRE_RenderSystem_GL_LIBRARIES ${OGRE_RenderSystem_GL_LIBRARIES}
     ${OPENGL_LIBRARIES}
   set(OGRE_RenderSystem_GLES_LIBRARIES ${OGRE_RenderSystem_GLES_LIBRARIES}
     ${OPENGLES_LIBRARIES}
   )
+  set(OGRE_RenderSystem_GLES2_LIBRARIES ${OGRE_RenderSystem_GLES2_LIBRARIES}
+    ${OPENGLES2_LIBRARIES}
+  )
   set(OGRE_Plugin_CgProgramManager_LIBRARIES ${OGRE_Plugin_CgProgramManager_LIBRARIES}
     ${Cg_LIBRARIES}
   )
 
 # look for the media directory
 set(OGRE_MEDIA_SEARCH_PATH
+  ${OGRE_SOURCE}
   ${OGRE_LIBRARY_DIR_REL}/..
   ${OGRE_LIBRARY_DIR_DBG}/..
   ${OGRE_LIBRARY_DIR_REL}/../..
   ${OGRE_PREFIX_SOURCE}
 )
 set(OGRE_MEDIA_SEARCH_SUFFIX
+  Samples/Media
   Media
   media
   share/OGRE/media
-  Samples/Media
 )
+
 clear_if_changed(OGRE_PREFIX_WATCH OGRE_MEDIA_DIR)
-find_path(OGRE_MEDIA_DIR NAMES packs/OgreCore.zip HINTS ${OGRE_MEDIA_SEARCH_PATH}
+find_path(OGRE_MEDIA_DIR NAMES packs/cubemapsJS.zip HINTS ${OGRE_MEDIA_SEARCH_PATH}
   PATHS ${OGRE_PREFIX_PATH} PATH_SUFFIXES ${OGRE_MEDIA_SEARCH_SUFFIX})
 

Ogitor/CMakeLists.txt

 include_directories(${DEPENDENCIES_INCLUDES})
 include_directories(include)
-
 set(Ogitor_hdrs
 	./include/AxisGizmo.h
 	./include/BaseEditor.h
 if(APPLE)
         find_package(Cocoa REQUIRED)
 	message(STATUS ${Cocoa_LIBRARIES})
-	target_link_libraries(Ogitor ${Cocoa_LIBRARIES})
+	target_link_libraries(Ogitor ${Cocoa_LIBRARIES} ${OGRE_LIBRARY} ${OGRE_Terrain_LIBRARY} ${OGRE_Paging_LIBRARY} PagedGeometry OFS ${Boost_LIBRARIES})
 	# Setup to be a framework
 	set_target_properties(Ogitor PROPERTIES FRAMEWORK TRUE)
 	set_target_properties(Ogitor PROPERTIES PUBLIC_HEADER "${HEADER_FILES}")
 	set_target_properties(Ogitor PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path/../Frameworks")
 endif(APPLE)
 
-if(UNIX)
+if(UNIX AND NOT APPLE)
   set_target_properties( Ogitor PROPERTIES OUTPUT_NAME "Ogitor" VERSION
 ${OGITOR_VERSION_STRING} SOVERSION ${abi_version} )
 endif()

SceneLoader/CMakeLists.txt

 
 	if(APPLE)
 		find_package(IOKIT REQUIRED)
-        TARGET_LINK_LIBRARIES(SampleLoadApp ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${IOKit_LIBRARIES} ${OGRE_Terrain_LIBRARY} PagedGeometry)
+                find_package(Cocoa REQUIRED)
+        TARGET_LINK_LIBRARIES(SampleLoadApp ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${IOKit_LIBRARIES} ${OGRE_Terrain_LIBRARY} PagedGeometry ${Cocoa_LIBRARIES})
     ELSE()
         TARGET_LINK_LIBRARIES(SampleLoadApp ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${OGRE_Terrain_LIBRARY} PagedGeometry ${Boost_LIBRARIES})
 	endif(APPLE)

qtOgitor/CMakeLists.txt

         if(NOT OGITOR_FRAMEWORK_FILE)
             file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/Ogitor/lib/Debug/Ogitor.framework")
         endif()
-
         set(COPY_FRAMEWORKS ${OGRE_LIBRARIES} ${Cg_LIBRARY_FWK} "${CMAKE_BINARY_DIR}/Ogitor/lib/Debug/Ogitor.framework")
         set(COPY_RESOURCES "${MAC_PATH}/resources.cfg" "${MAC_PATH}/plugins.cfg" "${RUNPATH}/Media")
         set(COPY_PLUGINS
         set(MakeBundle
             cp ${QtSolutions_PropertyBrowser_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libQtSolutions_PropertyBrowser*.dylib ${OGRE_Terrain_LIBRARY_DBG} ${OGRE_Paging_LIBRARY_DBG} ${qtOgitorLocationAppdir}/Contents/Components && 
             cp ${OGRE_RenderSystem_GL_LIBRARY_DBG} ${OGRE_Plugin_OctreeSceneManager_LIBRARY_DBG} ${OGRE_Plugin_ParticleFX_LIBRARY_DBG} ${OGRE_Plugin_CgProgramManager_LIBRARY_DBG} ${qtOgitorLocationAppdir}/Contents/Plugins && 
-            cp -r /Library/Frameworks/OGRE.framework ${qtOgitorLocationAppdir}/Contents/Frameworks && 
+            cp -r ${OGRE_LIBRARY}/{CMAKE_BUILD_TYPE}/Ogre.framework ${qtOgitorLocationAppdir}/Contents/Frameworks && 
             cp -r ../lib/${CMAKE_CFG_INTDIR}/Ogitor.framework ${qtOgitorLocationAppdir}/Contents/Frameworks && 
             cp ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgCaelum*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgHydrax*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgModularZone*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgSkyx*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libDotSceneSerializer*.dylib ${qtOgitorLocationAppdir}/Contents/Plugins/Ogitor && 
             cp -r ../RunPath/Media ${qtOgitorLocationAppdir}/Contents/Resources && 
     else(OGITOR_MESHMAGICK_INTERFACE)
         TARGET_LINK_LIBRARIES(qtOgitor QtSolutions_PropertyBrowser ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES} ${OGRE_LIBRARIES} ${OGRE_Paging_LIBRARY} ${OGRE_Terrain_LIBRARY} Ogitor GenericTextEditor GenericImageEditor ${Boost_REGEX_LIBRARY})
     endif(OGITOR_MESHMAGICK_INTERFACE)
-    if(UNIX AND NOT APPLE)
-        TARGET_LINK_LIBRARIES(qtOgitor optimized QtSolutions_PropertyBrowser ${Boost_LIBRARIES})
-    elseif(APPLE)
-        TARGET_LINK_LIBRARIES(qtOgitor QtSolutions_PropertyBrowser)
-    elseif(WIN32)
-        TARGET_LINK_LIBRARIES(qtOgitor optimized QtSolutions_PropertyBrowser)
-    endif()
 
     if(UNIX AND NOT APPLE)
         target_link_libraries(qtOgitor optimized QtSolutions_PropertyBrowser ${Boost_LIBRARIES})
     elseif(APPLE)
-        target_link_libraries(qtOgitor QtSolutions_PropertyBrowser)
+        find_package(Cocoa REQUIRED)
+        target_link_libraries(qtOgitor QtSolutions_PropertyBrowser ${Cocoa_LIBRARIES})
     elseif(WIN32)
         target_link_libraries(qtOgitor optimized QtSolutions_PropertyBrowser)
     endif()

qtOgitor/qtpropertybrowser-2.5/CMakeLists.txt

 
     ENDIF(UNIX AND NOT APPLE)
 
+    IF (APPLE)
+       set_target_properties(QtSolutions_PropertyBrowser
+       PROPERTIES BUILD_WITH_INSTALL_RPATH 1
+       INSTALL_NAME_DIR "@executable_path/../Components"
+    )
+    ENDIF (APPLE)
+
 ENDIF(NOT QT4_FOUND)
 

qtOgitor/src/paths.cpp

 #include <QtCore/QString>
 #endif
 
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
 std::string bundlePath()
 {
 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.