FindlibSRTP.cmake 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ############################################################################
  2. # FindSRTP.txt
  3. # Copyright (C) 2014 Belledonne Communications, Grenoble France
  4. #
  5. ############################################################################
  6. #
  7. # This program is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU General Public License
  9. # as published by the Free Software Foundation; either version 2
  10. # of the License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. #
  21. ############################################################################
  22. #
  23. # - Find the SRTP include file and library
  24. #
  25. # SRTP_FOUND - system has SRTP
  26. # SRTP_INCLUDE_DIRS - the SRTP include directory
  27. # SRTP_LIBRARIES - The libraries needed to use SRTP
  28. set(_SRTP_ROOT_PATHS
  29. ${CMAKE_INSTALL_PREFIX}
  30. )
  31. find_path(SRTP2_INCLUDE_DIRS
  32. NAMES srtp2/srtp.h
  33. HINTS _SRTP_ROOT_PATHS
  34. PATH_SUFFIXES include
  35. )
  36. if(SRTP2_INCLUDE_DIRS)
  37. set(HAVE_SRTP_SRTP_H 1)
  38. set(SRTP_INCLUDE_DIRS ${SRTP2_INCLUDE_DIRS})
  39. set(SRTP_VERSION 2)
  40. find_library(SRTP_LIBRARIES
  41. NAMES srtp2
  42. HINTS ${_SRTP_ROOT_PATHS}
  43. PATH_SUFFIXES bin lib
  44. )
  45. else()
  46. find_path(SRTP_INCLUDE_DIRS
  47. NAMES srtp/srtp.h
  48. HINTS _SRTP_ROOT_PATHS
  49. PATH_SUFFIXES include
  50. )
  51. if(SRTP_INCLUDE_DIRS)
  52. set(HAVE_SRTP_SRTP_H 1)
  53. set(SRTP_VERSION 1)
  54. endif()
  55. find_library(SRTP_LIBRARIES
  56. NAMES srtp
  57. HINTS ${_SRTP_ROOT_PATHS}
  58. PATH_SUFFIXES bin lib
  59. )
  60. endif()
  61. include(FindPackageHandleStandardArgs)
  62. find_package_handle_standard_args(libSRTP
  63. DEFAULT_MSG
  64. SRTP_INCLUDE_DIRS SRTP_LIBRARIES HAVE_SRTP_SRTP_H SRTP_VERSION
  65. )
  66. mark_as_advanced(SRTP_INCLUDE_DIRS SRTP_LIBRARIES HAVE_SRTP_SRTP_H SRTP_VERSION)