FindPhysFS.cmake 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file LICENSE.rst or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindPhysFS
  5. ----------
  6. Finds the PhysicsFS library (PhysFS) for file I/O abstraction:
  7. .. code-block:: cmake
  8. find_package(PhysFS [...])
  9. Result Variables
  10. ^^^^^^^^^^^^^^^^
  11. This module defines the following variables:
  12. ``PhysFS_FOUND``
  13. .. versionadded:: 3.3
  14. Boolean indicating whether the PhysicsFS library was found.
  15. Cache Variables
  16. ^^^^^^^^^^^^^^^
  17. The following cache variables may also be set:
  18. ``PHYSFS_INCLUDE_DIR``
  19. Directory containing the ``<physfs.h>`` and related headers needed for using
  20. the library.
  21. ``PHYSFS_LIBRARY``
  22. Path to the PhysicsFS library needed to link against.
  23. Hints
  24. ^^^^^
  25. This module accepts the following variables:
  26. ``PHYSFSDIR``
  27. Environment variable that can be set to help locate a PhysicsFS library
  28. installed in a custom location. It should point to the installation
  29. destination that was used when configuring, building, and installing PhysicsFS
  30. library: ``./configure --prefix=$PHYSFSDIR``.
  31. Deprecated Variables
  32. ^^^^^^^^^^^^^^^^^^^^
  33. The following variables are provided for backward compatibility:
  34. ``PHYSFS_FOUND``
  35. .. deprecated:: 4.2
  36. Use the ``PhysFS_FOUND``, which has the same value.
  37. Boolean indicating whether the PhysicsFS library was found.
  38. Examples
  39. ^^^^^^^^
  40. Finding the PhysicsFS library:
  41. .. code-block:: cmake
  42. find_package(PhysFS)
  43. #]=======================================================================]
  44. find_path(PHYSFS_INCLUDE_DIR physfs.h
  45. HINTS
  46. ENV PHYSFSDIR
  47. PATH_SUFFIXES include/physfs include
  48. PATHS
  49. ~/Library/Frameworks
  50. /Library/Frameworks
  51. /opt
  52. )
  53. find_library(PHYSFS_LIBRARY
  54. NAMES physfs
  55. HINTS
  56. ENV PHYSFSDIR
  57. PATH_SUFFIXES lib
  58. PATHS
  59. ~/Library/Frameworks
  60. /Library/Frameworks
  61. /opt
  62. )
  63. include(FindPackageHandleStandardArgs)
  64. find_package_handle_standard_args(PhysFS DEFAULT_MSG PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)