Ticket #32302: patch-CMake_Packages_FindOGRE.cmake.diff
File patch-CMake_Packages_FindOGRE.cmake.diff, 2.5 KB (added by marin.saric@…, 13 years ago) |
---|
-
CMake/Packages/FindOGRE.cmake
old new 68 68 set(OGRE_LIB_SUFFIX "") 69 69 endif () 70 70 71 if (APPLE AND OGRE_STATIC) 72 # If OGRE_STATIC, force CMake to select static versions 73 # of dependent libraries on MacOS X 74 SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) 75 SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.framework") 76 endif(APPLE AND OGRE_STATIC) 77 71 78 72 79 set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}") 73 80 get_debug_names(OGRE_LIBRARY_NAMES) … … 144 151 # try to locate Ogre via pkg-config 145 152 use_pkgconfig(OGRE_PKGC "OGRE${OGRE_LIB_SUFFIX}") 146 153 147 if(NOT OGRE_BUILD_PLATFORM_IPHONE) 148 # try to find framework on OSX 149 findpkg_framework(OGRE) 154 if(APPLE AND NOT OGRE_BUILD_PLATFORM_IPHONE) 155 if (NOT OGRE_STATIC) 156 # try to find framework on OSX 157 findpkg_framework(OGRE) 158 endif() 150 159 else() 151 160 set(OGRE_LIBRARY_FWK "") 152 161 endif() … … 258 267 endif () 259 268 endif () 260 269 261 set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_LIBRARY_FWK} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES} 262 ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES} 263 ${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB} 264 ${Cocoa_LIBRARIES} ${Carbon_LIBRARIES}) 270 list(APPEND OGRE_LIBRARIES 271 ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES} 272 ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES}) 265 273 266 274 if (NOT ZLIB_FOUND OR NOT ZZip_FOUND) 267 275 set(OGRE_DEPS_FOUND FALSE) … … 274 282 endif () 275 283 if (UNIX AND NOT APPLE) 276 284 if (NOT X11_FOUND) 277 285 set(OGRE_DEPS_FOUND FALSE) 278 286 endif () 287 288 list(APPEND OGRE_LIBRARIES 289 ${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB}) 279 290 endif () 280 291 292 if (APPLE) 293 list(APPEND OGRE_LIBRARIES 294 ${Cocoa_LIBRARIES} ${Carbon_LIBRARIES}) 295 # If FreeType is found on MacOS X, it has a hidden 296 # dependency on libbzip2 297 FIND_PACKAGE(BZip2 REQUIRED) 298 list(APPEND OGRE_LIBRARIES ${BZIP2_LIBRARIES}) 299 endif() 300 281 301 if (OGRE_CONFIG_THREADS) 282 302 if (OGRE_CONFIG_THREAD_PROVIDER EQUAL 1) 283 303 find_package(Boost COMPONENTS thread QUIET) … … 532 552 find_path(OGRE_MEDIA_DIR NAMES packs/cubemapsJS.zip HINTS ${OGRE_MEDIA_SEARCH_PATH} 533 553 PATHS ${OGRE_PREFIX_PATH} PATH_SUFFIXES ${OGRE_MEDIA_SEARCH_SUFFIX}) 534 554 555 if (APPLE AND OGRE_STATIC) 556 # Restore old CMAKE_FIND_LIBRARY_SUFFIXES on MacOS X 557 SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES}) 558 endif(APPLE AND OGRE_STATIC)