coturnConfig.cmake.in 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # - Try to find coturn
  2. #
  3. # Usage from an external project:
  4. # In your CMakeLists.txt, add these lines:
  5. #
  6. # find_package(coturn)
  7. # target_link_libraries(MY_TARGET_NAME ${coturn_LIBRARIES})
  8. #
  9. # This file will define the following variables:
  10. # coturn_FOUND: True if find coturn, other false
  11. # coturn_LIBRARIES: The list of all imported targets for coturn components
  12. #
  13. # Author: Kang Lin <[email protected]>
  14. include(FindPackageHandleStandardArgs)
  15. if (NOT coturn_FIND_COMPONENTS)
  16. set(coturn_FIND_COMPONENTS
  17. turncommon
  18. turnclient
  19. turn_server
  20. )
  21. endif()
  22. get_filename_component(_coturn_module_paths "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
  23. set(_coturn_FIND_PARTS_REQUIRED)
  24. if (coturn_FIND_REQUIRED)
  25. set(_coturn_FIND_PARTS_REQUIRED REQUIRED)
  26. endif()
  27. set(_coturn_FIND_PARTS_QUIET)
  28. if (coturn_FIND_QUIETLY)
  29. set(_coturn_FIND_PARTS_QUIET QUIET)
  30. endif()
  31. foreach(module ${coturn_FIND_COMPONENTS})
  32. find_package(${module}
  33. ${_coturn_FIND_PARTS_QUIET}
  34. ${_coturn_FIND_PARTS_REQUIRED}
  35. PATHS ${_coturn_module_paths} NO_DEFAULT_PATH
  36. )
  37. if(${module}_FOUND)
  38. list(APPEND coturn_LIBRARIES coturn::${module})
  39. endif()
  40. list(APPEND required "${module}_FOUND")
  41. endforeach()
  42. # Run checks via find_package_handle_standard_args
  43. find_package_handle_standard_args(coturn
  44. FOUND_VAR coturn_FOUND
  45. REQUIRED_VARS ${required})