|
|
|
@ -18,7 +18,7 @@
|
|
|
|
|
# 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)
|
|
|
|
@ -35,7 +35,7 @@
|
|
|
|
|
#
|
|
|
|
|
# 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)
|
|
|
|
|
#
|
|
|
|
@ -110,9 +110,9 @@ if (OGRE_PREFIX_SOURCE AND 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})
|
|
|
|
|
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})
|
|
|
|
@ -124,12 +124,12 @@ else()
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
# redo search if any of the environmental hints changed
|
|
|
|
|
set(OGRE_COMPONENTS Paging Terrain
|
|
|
|
|
set(OGRE_COMPONENTS Paging Terrain Overlay
|
|
|
|
|
Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager
|
|
|
|
|
Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX
|
|
|
|
|
RenderSystem_Direct3D10 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GLES2)
|
|
|
|
|
set(OGRE_RESET_VARS
|
|
|
|
|
OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR
|
|
|
|
|
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})
|
|
|
|
@ -148,7 +148,7 @@ if(NOT OGRE_BUILD_PLATFORM_IPHONE AND APPLE)
|
|
|
|
|
# try to find framework on OSX
|
|
|
|
|
findpkg_framework(OGRE)
|
|
|
|
|
else()
|
|
|
|
|
set(OGRE_LIBRARY_FWK "")
|
|
|
|
|
set(OGRE_LIBRARY_FWK "")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# locate Ogre include files
|
|
|
|
@ -215,8 +215,8 @@ 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")
|
|
|
|
|
# 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)
|
|
|
|
@ -259,13 +259,13 @@ if (OGRE_STATIC)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (ANDROID)
|
|
|
|
|
set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_LIBRARY_FWK} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
|
|
|
|
|
${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
|
|
|
|
|
set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_LIBRARY_FWK} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
|
|
|
|
|
${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
|
|
|
|
|
${Cocoa_LIBRARIES} ${Carbon_LIBRARIES})
|
|
|
|
|
else ()
|
|
|
|
|
set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_LIBRARY_FWK} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
|
|
|
|
|
${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
|
|
|
|
|
${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB}
|
|
|
|
|
set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_LIBRARY_FWK} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES}
|
|
|
|
|
${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}
|
|
|
|
|
${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB}
|
|
|
|
|
${Cocoa_LIBRARIES} ${Carbon_LIBRARIES})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
@ -279,9 +279,9 @@ endif()
|
|
|
|
|
set(OGRE_DEPS_FOUND FALSE)
|
|
|
|
|
endif ()
|
|
|
|
|
if (UNIX AND NOT APPLE AND NOT ANDROID)
|
|
|
|
|
if (NOT X11_FOUND)
|
|
|
|
|
if (NOT X11_FOUND)
|
|
|
|
|
set(OGRE_DEPS_FOUND FALSE)
|
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (OGRE_CONFIG_THREADS)
|
|
|
|
@ -311,7 +311,7 @@ endif()
|
|
|
|
|
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)
|
|
|
|
@ -329,13 +329,13 @@ 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}
|
|
|
|
|
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}
|
|
|
|
|
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()
|
|
|
|
|
mark_as_advanced(OGRE_BINARY_REL OGRE_BINARY_DBG)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -343,7 +343,7 @@ endif()
|
|
|
|
|
# Find Ogre components
|
|
|
|
|
#########################################################
|
|
|
|
|
|
|
|
|
|
set(OGRE_COMPONENT_SEARCH_PATH_REL
|
|
|
|
|
set(OGRE_COMPONENT_SEARCH_PATH_REL
|
|
|
|
|
${OGRE_LIBRARY_DIR_REL}/..
|
|
|
|
|
${OGRE_LIBRARY_DIR_REL}/../..
|
|
|
|
|
${OGRE_BIN_SEARCH_PATH}
|
|
|
|
@ -366,17 +366,19 @@ macro(ogre_find_component COMPONENT HEADER)
|
|
|
|
|
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)
|
|
|
|
|
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
|
|
|
|
|
ogre_find_component(Paging OgrePaging.h)
|
|
|
|
|
# look for Overlay component
|
|
|
|
|
ogre_find_component(Overlay OgreOverlay.h)
|
|
|
|
|
# look for Terrain component
|
|
|
|
|
ogre_find_component(Terrain OgreTerrain.h)
|
|
|
|
|
# look for Property component
|
|
|
|
@ -395,17 +397,17 @@ macro(ogre_find_plugin PLUGIN HEADER)
|
|
|
|
|
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}")
|
|
|
|
@ -443,15 +445,15 @@ macro(ogre_find_plugin PLUGIN HEADER)
|
|
|
|
|
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}
|
|
|
|
|
${OGRE_BIN_SEARCH_PATH}
|
|
|
|
|
)
|
|
|
|
|
set(OGRE_PLUGIN_SEARCH_PATH_DBG
|
|
|
|
|
${OGRE_LIBRARY_DIR_DBG}/..
|
|
|
|
|
${OGRE_LIBRARY_DIR_DBG}/../..
|
|
|
|
|
${OGRE_BIN_SEARCH_PATH}
|
|
|
|
|
${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 release)
|
|
|
|
@ -468,16 +470,16 @@ macro(ogre_find_plugin PLUGIN HEADER)
|
|
|
|
|
set(OGRE_PLUGIN_DIR_DBG ${OGRE_PLUGIN_DIR_TMP})
|
|
|
|
|
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()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
@ -521,7 +523,7 @@ if (OGRE_STATIC)
|
|
|
|
|
if (NOT Cg_FOUND)
|
|
|
|
|
set(OGRE_Plugin_CgProgramManager_FOUND FALSE)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set(OGRE_RenderSystem_Direct3D9_LIBRARIES ${OGRE_RenderSystem_Direct3D9_LIBRARIES}
|
|
|
|
|
${DirectX9_LIBRARIES}
|
|
|
|
|
)
|
|
|
|
|