Cdroid/cmake/modules/FindBZip2.cmake

28 lines
784 B
CMake
Raw Normal View History

2022-11-30 17:11:10 +08:00
find_package(PkgConfig)
pkg_check_modules(PC_BZIP2 bzip2)
find_path(BZIP2_INCLUDE_DIRS
NAMES bzlib.h
HINTS ${PC_BZIP2_INCLUDEDIR}
${PC_BZIP2_INCLUDE_DIRS}
)
find_library(BZIP2_LIBRARIES
NAMES bz2 bz2d
2022-11-30 17:11:10 +08:00
HINTS ${PC_BZIP2_LIBDIR}
${PC_BZIP2_LIBRARY_DIRS}
)
if(BZIP2_INCLUDE_DIRS AND BZIP2_LIBRARIES)
set(BZIP2_FOUND TRUE)
set(BZIP2_LIBRARY ${BZIP2_LIBRARIES})
set(BZIP2_INCLUDE_DIR ${BZIP2_INCLUDE_DIRS})
set(BZIP2_VERSION ${PC_BZIP2_VERSION})
endif()
include(FindPackageHandleStandardArgs)
#FIND_PACKAGE_HANDLE_STANDARD_ARGS(zlib REQUIRED_VARS BZIP2_INCLUDE_DIRS BZIP2_LIBRARIES
# FOUND_VAR BZIP2_FOUND VERSION_VAR BZIP2_VERSION)
mark_as_advanced(BZIP2_LIBRARIES BZIP2_LIBRARY BZIP2_INCLUDE_DIRS BZIP2_INCLUDE_DIR BZIP2_FOUND BZIP2_VERSION)