FindOIS.cmake 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #This has been modified fron the original
  2. include(${RakNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/PreprocessorUtils.cmake)
  3. include(${RakNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/FindPkgMacros.cmake)
  4. #-------------------------------------------------------------------
  5. # This file is part of the CMake build system for OGRE
  6. # (Object-oriented Graphics Rendering Engine)
  7. # For the latest info, see http://www.ogre3d.org/
  8. #
  9. # The contents of this file are placed in the public domain. Feel
  10. # free to make use of it in any way you like.
  11. #-------------------------------------------------------------------
  12. # - Try to find OIS
  13. # Once done, this will define
  14. #
  15. # OIS_FOUND - system has OIS
  16. # OIS_INCLUDE_DIRS - the OIS include directories
  17. # OIS_LIBRARIES - link these to use OIS
  18. #include(FindPkgMacros)
  19. findpkg_begin(OIS)
  20. # Get path, convert backslashes as ${ENV_${var}}
  21. getenv_path(OIS_HOME)
  22. getenv_path(OGRE_HOME)
  23. getenv_path(OGRE_SOURCE)
  24. # construct search paths
  25. set(OIS_PREFIX_PATH ${OIS_HOME} ${ENV_OIS_HOME}
  26. ${OGRE_SOURCE}/iPhoneDependencies ${ENV_OGRE_SOURCE}/iPhoneDependencies
  27. ${OGRE_SOURCE}/Dependencies ${ENV_OGRE_SOURCE}/Dependencies
  28. ${OGRE_HOME} ${ENV_OGRE_HOME})
  29. create_search_paths(OIS)
  30. # redo search if prefix path changed
  31. clear_if_changed(OIS_PREFIX_PATH
  32. OIS_LIBRARY_FWK
  33. OIS_LIBRARY_REL
  34. OIS_LIBRARY_DBG
  35. OIS_INCLUDE_DIR
  36. )
  37. set(OIS_LIBRARY_NAMES OIS)
  38. get_debug_names(OIS_LIBRARY_NAMES)
  39. use_pkgconfig(OIS_PKGC OIS)
  40. # For OIS, prefer static library over framework (important when referencing OIS source build)
  41. set(CMAKE_FIND_FRAMEWORK "LAST")
  42. findpkg_framework(OIS)
  43. if (OIS_HOME)
  44. # OIS uses the 'includes' path for its headers in the source release, not 'include'
  45. set(OIS_INC_SEARCH_PATH ${OIS_INC_SEARCH_PATH} ${OIS_HOME}/includes)
  46. endif()
  47. if (APPLE AND OIS_HOME)
  48. # OIS source build on Mac stores libs in a different location
  49. # Also this is for static build
  50. set(OIS_LIB_SEARCH_PATH ${OIS_LIB_SEARCH_PATH} ${OIS_HOME}/Mac/XCode-2.2/build)
  51. endif()
  52. find_path(OIS_INCLUDE_DIR NAMES OIS.h HINTS ${OIS_INC_SEARCH_PATH} ${OIS_PKGC_INCLUDE_DIRS} PATH_SUFFIXES OIS)
  53. find_library(OIS_LIBRARY_REL NAMES ${OIS_LIBRARY_NAMES} HINTS ${OIS_LIB_SEARCH_PATH} ${OIS_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
  54. find_library(OIS_LIBRARY_DBG NAMES ${OIS_LIBRARY_NAMES_DBG} HINTS ${OIS_LIB_SEARCH_PATH} ${OIS_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
  55. make_library_set(OIS_LIBRARY)
  56. findpkg_finish(OIS)
  57. # Reset framework finding
  58. set(CMAKE_FIND_FRAMEWORK "FIRST")
粤ICP备19079148号