You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.4 KiB

  1. #[=======================================================================[.rst:
  2. FindLV2
  3. -----------
  4. Finds the LV2 library.
  5. Imported Targets
  6. ^^^^^^^^^^^^^^^^
  7. This module provides the following imported targets, if found:
  8. ``LV2::LV2``
  9. The LV2 library
  10. Result Variables
  11. ^^^^^^^^^^^^^^^^
  12. This will define the following variables:
  13. ``LV2_FOUND``
  14. True if the system has the LV2 library.
  15. ``LV2_INCLUDE_DIRS``
  16. Include directories needed to use LV2.
  17. ``LV2_LIBRARIES``
  18. Libraries needed to link to LV2.
  19. ``LV2_DEFINITIONS``
  20. Compile definitions needed to use LV2.
  21. Cache Variables
  22. ^^^^^^^^^^^^^^^
  23. The following cache variables may also be set:
  24. ``LV2_INCLUDE_DIR``
  25. The directory containing ``lv2.h``.
  26. #]=======================================================================]
  27. find_package(PkgConfig QUIET)
  28. if(PkgConfig_FOUND)
  29. pkg_check_modules(PC_LV2 QUIET lv2)
  30. endif()
  31. # There is no library; only a header.
  32. find_path(LV2_INCLUDE_DIR
  33. NAMES lv2.h
  34. PATHS ${PC_LV2_INCLUDE_DIRS}
  35. PATH_SUFFIXES LV2
  36. DOC "LV2 include directory")
  37. mark_as_advanced(LV2_INCLUDE_DIR)
  38. include(FindPackageHandleStandardArgs)
  39. find_package_handle_standard_args(
  40. LV2
  41. DEFAULT_MSG
  42. LV2_INCLUDE_DIR
  43. )
  44. if(LV2_FOUND)
  45. if(NOT TARGET LV2::LV2)
  46. add_library(LV2::LV2 INTERFACE IMPORTED)
  47. set_target_properties(LV2::LV2
  48. PROPERTIES
  49. INTERFACE_COMPILE_OPTIONS "${PC_LV2_CFLAGS_OTHER}"
  50. INTERFACE_INCLUDE_DIRECTORIES "${LV2_INCLUDE_DIR}"
  51. )
  52. endif()
  53. endif()