FindAudaspace.cmake 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # - Try to find audaspace
  2. # Once done, this will define
  3. #
  4. # AUDASPACE_FOUND - system has audaspace
  5. # AUDASPACE_INCLUDE_DIRS - the audaspace include directories
  6. # AUDASPACE_LIBRARIES - link these to use audaspace
  7. # AUDASPACE_C_FOUND - system has audaspace's C binding
  8. # AUDASPACE_C_INCLUDE_DIRS - the audaspace's C binding include directories
  9. # AUDASPACE_C_LIBRARIES - link these to use audaspace's C binding
  10. # AUDASPACE_PY_FOUND - system has audaspace's python binding
  11. # AUDASPACE_PY_INCLUDE_DIRS - the audaspace's python binding include directories
  12. # AUDASPACE_PY_LIBRARIES - link these to use audaspace's python binding
  13. IF(NOT AUDASPACE_ROOT_DIR AND NOT $ENV{AUDASPACE_ROOT_DIR} STREQUAL "")
  14. SET(AUDASPACE_ROOT_DIR $ENV{AUDASPACE_ROOT_DIR})
  15. ENDIF()
  16. SET(_audaspace_SEARCH_DIRS
  17. ${AUDASPACE_ROOT_DIR}
  18. /usr/local
  19. /sw # Fink
  20. /opt/local # DarwinPorts
  21. /opt/csw # Blastwave
  22. )
  23. # Use pkg-config to get hints about paths
  24. FIND_PACKAGE(PkgConfig)
  25. IF(PKG_CONFIG_FOUND)
  26. PKG_CHECK_MODULES(AUDASPACE_PKGCONF audaspace)
  27. ENDIF(PKG_CONFIG_FOUND)
  28. # Include dir
  29. FIND_PATH(AUDASPACE_INCLUDE_DIR
  30. NAMES ISound.h
  31. HINTS ${_audaspace_SEARCH_DIRS}
  32. PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
  33. PATH_SUFFIXES include/audaspace
  34. )
  35. # Library
  36. FIND_LIBRARY(AUDASPACE_LIBRARY
  37. NAMES audaspace
  38. HINTS ${_audaspace_SEARCH_DIRS}
  39. PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
  40. PATH_SUFFIXES lib lib64
  41. )
  42. # Include dir
  43. FIND_PATH(AUDASPACE_C_INCLUDE_DIR
  44. NAMES AUD_Sound.h
  45. HINTS ${_audaspace_SEARCH_DIRS}
  46. PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
  47. PATH_SUFFIXES include/audaspace
  48. )
  49. # Library
  50. FIND_LIBRARY(AUDASPACE_C_LIBRARY
  51. NAMES audaspace-c
  52. HINTS ${_audaspace_SEARCH_DIRS}
  53. PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
  54. PATH_SUFFIXES lib lib64
  55. )
  56. # Include dir
  57. FIND_PATH(AUDASPACE_PY_INCLUDE_DIR
  58. NAMES python/PyAPI.h
  59. HINTS ${_audaspace_SEARCH_DIRS}
  60. PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
  61. PATH_SUFFIXES include/audaspace
  62. )
  63. # Library
  64. FIND_LIBRARY(AUDASPACE_PY_LIBRARY
  65. NAMES audaspace-py
  66. HINTS ${_audaspace_SEARCH_DIRS}
  67. PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
  68. PATH_SUFFIXES lib lib64
  69. )
  70. FIND_PACKAGE(PackageHandleStandardArgs)
  71. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace DEFAULT_MSG AUDASPACE_LIBRARY AUDASPACE_INCLUDE_DIR)
  72. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_C DEFAULT_MSG AUDASPACE_C_LIBRARY AUDASPACE_C_INCLUDE_DIR)
  73. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_Py DEFAULT_MSG AUDASPACE_PY_LIBRARY AUDASPACE_PY_INCLUDE_DIR)
  74. IF(AUDASPACE_FOUND)
  75. SET(AUDASPACE_LIBRARIES ${AUDASPACE_LIBRARY})
  76. SET(AUDASPACE_INCLUDE_DIRS ${AUDASPACE_INCLUDE_DIR})
  77. ENDIF(AUDASPACE_FOUND)
  78. IF(AUDASPACE_C_FOUND)
  79. SET(AUDASPACE_C_LIBRARIES ${AUDASPACE_C_LIBRARY})
  80. SET(AUDASPACE_C_INCLUDE_DIRS ${AUDASPACE_C_INCLUDE_DIR})
  81. ENDIF(AUDASPACE_C_FOUND)
  82. IF(AUDASPACE_PY_FOUND)
  83. SET(AUDASPACE_PY_LIBRARIES ${AUDASPACE_PY_LIBRARY})
  84. SET(AUDASPACE_PY_INCLUDE_DIRS ${AUDASPACE_PY_INCLUDE_DIR})
  85. ENDIF(AUDASPACE_PY_FOUND)
  86. MARK_AS_ADVANCED(
  87. AUDASPACE_LIBRARY
  88. AUDASPACE_LIBRARIES
  89. AUDASPACE_INCLUDE_DIR
  90. AUDASPACE_INCLUDE_DIRS
  91. AUDASPACE_C_LIBRARY
  92. AUDASPACE_C_LIBRARIES
  93. AUDASPACE_C_INCLUDE_DIR
  94. AUDASPACE_C_INCLUDE_DIRS
  95. AUDASPACE_PY_LIBRARY
  96. AUDASPACE_PY_LIBRARIES
  97. AUDASPACE_PY_INCLUDE_DIR
  98. AUDASPACE_PY_INCLUDE_DIRS
  99. )