FindUsrsctp.cmake 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #[=======================================================================[.rst
  2. FindUsrsctp
  3. ----------
  4. FindModule for Usrsctp library
  5. Imported Targets
  6. ^^^^^^^^^^^^^^^^
  7. This module defines the :prop_tgt:`IMPORTED` target ``Usrsctp::Usrsctp``.
  8. Result Variables
  9. ^^^^^^^^^^^^^^^^
  10. This module sets the following variables:
  11. ``Usrsctp_FOUND``
  12. True, if the library was found.
  13. #]=======================================================================]
  14. include(FindPackageHandleStandardArgs)
  15. find_path(
  16. Usrsctp_INCLUDE_DIR
  17. NAMES usrsctp.h
  18. PATHS /usr/include /usr/local/include)
  19. find_library(
  20. Usrsctp_LIBRARY
  21. NAMES usrsctp libusrsctp
  22. PATHS /usr/lib /usr/local/lib)
  23. find_package_handle_standard_args(
  24. Usrsctp
  25. REQUIRED_VARS Usrsctp_LIBRARY Usrsctp_INCLUDE_DIR)
  26. mark_as_advanced(Usrsctp_INCLUDE_DIR Usrsctp_LIBRARY)
  27. if(Usrsctp_FOUND)
  28. if(NOT TARGET Usrsctp::Usrsctp)
  29. if(IS_ABSOLUTE "${Usrsctp_LIBRARY}")
  30. add_library(Usrsctp::Usrsctp UNKNOWN IMPORTED)
  31. set_property(TARGET Usrsctp::Usrsctp PROPERTY IMPORTED_LOCATION "${Usrsctp_LIBRARY}")
  32. else()
  33. add_library(Usrsctp::Usrsctp INTERFACE IMPORTED)
  34. set_property(TARGET Usrsctp::Usrsctp PROPERTY IMPORTED_LIBNAME "${Usrsctp_LIBRARY}")
  35. endif()
  36. set_target_properties(Usrsctp::Usrsctp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Usrsctp_INCLUDE_DIR}")
  37. endif()
  38. endif()