1 #######################################################################
2 # Find all necessary and optional OGRE dependencies
3 #######################################################################
5 # OGRE_DEPENDENCIES_DIR can be used to specify a single base
6 # folder where the required dependencies may be found.
7 set(OGRE_DEPENDENCIES_DIR "" CACHE PATH "Path to prebuilt OGRE dependencies")
9 getenv_path(OGRE_DEPENDENCIES_DIR)
10 set(OGRE_DEP_SEARCH_PATH
11 ${OGRE_DEPENDENCIES_DIR}
12 ${ENV_OGRE_DEPENDENCIES_DIR}
13 "${OGRE_BINARY_DIR}/Dependencies"
14 "${OGRE_SOURCE_DIR}/Dependencies"
15 "${OGRE_BINARY_DIR}/../Dependencies"
16 "${OGRE_SOURCE_DIR}/../Dependencies"
19 # Set hardcoded path guesses for various platforms
21 set(OGRE_DEP_SEARCH_PATH ${OGRE_DEP_SEARCH_PATH} /usr/local)
24 # give guesses as hints to the find_package calls
25 set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${OGRE_DEP_SEARCH_PATH})
26 set(CMAKE_FRAMEWORK_PATH ${CMAKE_FRAMEWORK_PATH} ${OGRE_DEP_SEARCH_PATH})
28 # see if there is an install directive somewhere in the dependencies folders
29 find_file(OGRE_DEP_INSTALL_FILE OgreInstallDependencies.cmake
30 HINTS ${OGRE_DEP_SEARCH_PATH} NO_DEFAULT_PATH)
31 mark_as_advanced(OGRE_DEP_INSTALL_FILE)
32 if (OGRE_DEP_INSTALL_FILE)
33 include(${OGRE_DEP_INSTALL_FILE})
37 #######################################################################
39 #######################################################################
43 macro_log_feature(ZLIB_FOUND "zlib" "Simple data compression library" "http://www.zlib.net" TRUE "" "")
47 macro_log_feature(ZZip_FOUND "zziplib" "Extract data from zip archives" "http://zziplib.sourceforge.net" TRUE "" "")
50 find_package(FreeImage)
51 macro_log_feature(FreeImage_FOUND "freeimage" "Support for commonly used graphics image formats" "http://freeimage.sourceforge.net" FALSE "" "")
54 find_package(Freetype)
55 macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" TRUE "" "")
60 macro_log_feature(X11_FOUND "X11" "X Window system" "http://www.x.org" TRUE "" "")
61 macro_log_feature(X11_Xt_FOUND "Xt" "X Toolkit" "http://www.x.org" TRUE "" "")
62 find_library(XAW_LIBRARY NAMES Xaw Xaw7 PATHS ${DEP_LIB_SEARCH_DIR} ${X11_LIB_SEARCH_PATH})
63 macro_log_feature(XAW_LIBRARY "Xaw" "X11 Athena widget set" "http://www.x.org" TRUE "" "")
64 mark_as_advanced(XAW_LIBRARY)
68 #######################################################################
69 # RenderSystem dependencies
70 #######################################################################
74 macro_log_feature(OPENGL_FOUND "opengl" "Support for the OpenGL render system" "" FALSE "" "")
77 find_package(OpenGLES)
78 macro_log_feature(OPENGLES_FOUND "opengles" "Support for the OpenGL ES render system" "" FALSE "" "")
83 macro_log_feature(DirectX_FOUND "DirectX" "Support for the DirectX render system" "http://msdn.microsoft.com/en-us/directx/" FALSE "" "")
86 #######################################################################
88 #######################################################################
92 macro_log_feature(Cg_FOUND "cg" "C for graphics shader language" "http://developer.nvidia.com/object/cg_toolkit.html" FALSE "" "")
95 # Prefer static linking in all cases
96 set(Boost_USE_STATIC_LIBS TRUE)
97 set(Boost_ADDITIONAL_VERSIONS "1.37.0" "1.37" "1.38.0" "1.38")
98 # Components that need linking (NB does not include heaader-only components like bind)
99 set(OGRE_BOOST_COMPONENTS thread date_time)
100 find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
103 set(Boost_USE_STATIC_LIBS FALSE)
104 find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
106 # Optional Boost libs (Boost_${COMPONENT}_FOUND
107 macro_log_feature(Boost_FOUND "boost" "Boost (general)" "http://boost.org" FALSE "" "")
108 macro_log_feature(Boost_THREAD_FOUND "boost-thread" "Used for threading support" "http://boost.org" FALSE "" "")
109 macro_log_feature(Boost_DATE_TIME_FOUND "boost-date_time" "Used for threading support" "http://boost.org" FALSE "" "")
113 macro_log_feature(Poco_FOUND "POCO" "POCO framework" "http://pocoproject.org/" FALSE "" "")
117 #######################################################################
118 # Samples dependencies
119 #######################################################################
123 macro_log_feature(CEGUI_FOUND "CEGUI" "GUI system used for some of the samples" "http://www.cegui.org.uk" FALSE "" "")
127 macro_log_feature(OIS_FOUND "OIS" "Input library needed for the samples" "http://sourceforge.net/projects/wgois" FALSE "" "")
129 #######################################################################
131 #######################################################################
133 find_package(Doxygen)
134 macro_log_feature(DOXYGEN_FOUND "Doxygen" "Tool for building API documentation" "http://doxygen.org" FALSE "" "")
136 #######################################################################
138 #######################################################################
140 find_package(CppUnit)
141 macro_log_feature(CppUnit_FOUND "CppUnit" "Library for performing unit tests" "http://cppunit.sourceforge.net" FALSE "" "")
143 #######################################################################
145 #######################################################################
148 macro_log_feature(Carbon_FOUND "Carbon" "Carbon" "http://www.apple.com" TRUE "" "")
151 macro_log_feature(Cocoa_FOUND "Cocoa" "Cocoa" "http://www.apple.com" TRUE "" "")
154 macro_log_feature(IOKit_FOUND "IOKit" "IOKit HID framework needed by the samples" "http://www.apple.com" FALSE "" "")
157 # Display results, terminate if anything required is missing
158 MACRO_DISPLAY_FEATURE_LOG()
161 # Add library and include paths from the dependencies
165 ${FreeImage_INCLUDE_DIRS}
166 ${FREETYPE_INCLUDE_DIRS}
167 ${OPENGL_INCLUDE_DIRS}
168 ${CEGUI_INCLUDE_DIRS}
171 ${BOOST_INCLUDE_DIRS}
173 ${DirectX_INCLUDE_DIRS}
174 ${CppUnit_INCLUDE_DIRS}
175 ${Carbon_INCLUDE_DIRS}
176 ${Cocoa_INCLUDE_DIRS}
179 ${OPENGL_LIBRARY_DIRS}
181 ${BOOST_LIBRARY_DIRS}
183 ${DirectX_LIBRARY_DIRS}
184 ${CppUnit_LIBRARY_DIRS}