FindBZip2.cmake 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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_DEFINITIONS - Compiler switches required for using BZip2
  8. # BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
  9. # Copyright (c) 2006, Alexander Neundorf, <[email protected]>
  10. #
  11. # Redistribution and use is allowed according to the terms of the BSD license.
  12. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  13. IF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)
  14. SET(BZip2_FIND_QUIETLY TRUE)
  15. ENDIF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)
  16. FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )
  17. FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2 )
  18. # handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
  19. # all listed variables are TRUE
  20. INCLUDE(FindPackageHandleStandardArgs)
  21. FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2 DEFAULT_MSG BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
  22. IF (BZIP2_FOUND)
  23. INCLUDE(CheckLibraryExists)
  24. CHECK_LIBRARY_EXISTS(${BZIP2_LIBRARIES} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
  25. ENDIF (BZIP2_FOUND)
  26. MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES)