FindBZip2.cmake 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # - Try to find BZip2
  2. # Once done this will define
  3. #
  4. # BZIP2_FOUND - system has BZip2
  5. # BZIP2_INCLUDE_DIR - the BZip2 include directory
  6. # BZIP2_LIBRARIES - Link these to use BZip2
  7. # BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
  8. #=============================================================================
  9. # Copyright 2006-2009 Kitware, Inc.
  10. # Copyright 2006 Alexander Neundorf <[email protected]>
  11. #
  12. # Distributed under the OSI-approved BSD License (the "License");
  13. # see accompanying file Copyright.txt for details.
  14. #
  15. # This software is distributed WITHOUT ANY WARRANTY; without even the
  16. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. # See the License for more information.
  18. #=============================================================================
  19. # (To distribute this file outside of CMake, substitute the full
  20. # License text for the above reference.)
  21. FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )
  22. FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2 )
  23. # handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
  24. # all listed variables are TRUE
  25. INCLUDE(FindPackageHandleStandardArgs)
  26. FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2 DEFAULT_MSG BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
  27. IF (BZIP2_FOUND)
  28. INCLUDE(CheckLibraryExists)
  29. CHECK_LIBRARY_EXISTS(${BZIP2_LIBRARIES} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
  30. ENDIF (BZIP2_FOUND)
  31. MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES)