FindLibVLC.cmake 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Once done these will be defined:
  2. #
  3. # LIBVLC_FOUND
  4. # LIBVLC_INCLUDE_DIRS
  5. # LIBVLC_LIBRARIES
  6. #
  7. find_package(PkgConfig QUIET)
  8. if (PKG_CONFIG_FOUND)
  9. pkg_check_modules(_VLC QUIET libvlc)
  10. endif()
  11. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  12. set(_lib_suffix 64)
  13. else()
  14. set(_lib_suffix 32)
  15. endif()
  16. find_path(VLC_INCLUDE_DIR
  17. NAMES libvlc.h
  18. HINTS
  19. ENV VLCPath${_lib_suffix}
  20. ENV VLCPath
  21. ENV DepsPath${_lib_suffix}
  22. ENV DepsPath
  23. ${VLCPath${_lib_suffix}}
  24. ${VLCPath}
  25. ${DepsPath${_lib_suffix}}
  26. ${DepsPath}
  27. ${_VLC_INCLUDE_DIRS}
  28. PATHS
  29. /usr/include /usr/local/include /opt/local/include /sw/include
  30. PATH_SUFFIXES
  31. vlc include/vlc include)
  32. find_library(VLC_LIB
  33. NAMES ${_VLC_LIBRARIES} VLC libVLC
  34. HINTS
  35. ENV VLCPath${_lib_suffix}
  36. ENV VLCPath
  37. ENV DepsPath${_lib_suffix}
  38. ENV DepsPath
  39. ${VLCPath${_lib_suffix}}
  40. ${VLCPath}
  41. ${DepsPath${_lib_suffix}}
  42. ${DepsPath}
  43. ${_VLC_LIBRARY_DIRS}
  44. PATHS
  45. /usr/lib /usr/local/lib /opt/local/lib /sw/lib
  46. PATH_SUFFIXES
  47. lib${_lib_suffix} lib
  48. libs${_lib_suffix} libs
  49. bin${_lib_suffix} bin
  50. ../lib${_lib_suffix} ../lib
  51. ../libs${_lib_suffix} ../libs
  52. ../bin${_lib_suffix} ../bin)
  53. include(FindPackageHandleStandardArgs)
  54. # OBS doesnt depend on linking, so we dont include VLC_LIB here as required.
  55. find_package_handle_standard_args(LibVLC DEFAULT_MSG VLC_INCLUDE_DIR)
  56. mark_as_advanced(VLC_INCLUDE_DIR VLC_LIB)
  57. if(LIBVLC_FOUND)
  58. set(LIBVLC_LIBRARIES ${VLC_LIB})
  59. set(LIBVLC_INCLUDE_DIRS ${VLC_INCLUDE_DIR})
  60. endif()