FindLIBARCHIVE.cmake 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ################################################################################
  2. # Copyright (C) 2011 HPCC Systems.
  3. #
  4. # All rights reserved. This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as
  6. # published by the Free Software Foundation, either version 3 of the
  7. # License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. ################################################################################
  17. # - Try to find the libarchive archive decompression library
  18. # Once done this will define
  19. #
  20. # LIBARCHIVE_FOUND - system has the libarchive library
  21. # LIBARCHIVE_INCLUDE_DIR - the libarchive include directory
  22. # LIBARCHIVE_LIBRARIES - The libraries needed to use libarchive
  23. IF (NOT LIBARCHIVE_FOUND)
  24. IF (WIN32)
  25. SET (libarchive_lib "libarchive")
  26. ELSE()
  27. SET (libarchive_lib "archive")
  28. ENDIF()
  29. FIND_PATH (LIBARCHIVE_INCLUDE_DIR NAMES archive.h)
  30. FIND_LIBRARY (LIBARCHIVE_LIBRARIES NAMES ${libarchive_lib})
  31. include(FindPackageHandleStandardArgs)
  32. find_package_handle_standard_args(libarchive DEFAULT_MSG
  33. LIBARCHIVE_LIBRARIES
  34. LIBARCHIVE_INCLUDE_DIR
  35. )
  36. MARK_AS_ADVANCED(LIBARCHIVE_INCLUDE_DIR LIBARCHIVE_LIBRARIES)
  37. ENDIF()