xref: /aosp_15_r20/external/bcc/cmake/FindLibLzma.cmake (revision 387f9dfdfa2baef462e92476d413c7bc2470293e)
1*387f9dfdSAndroid Build Coastguard Worker# - Try to find liblzma
2*387f9dfdSAndroid Build Coastguard Worker# Once done this will define
3*387f9dfdSAndroid Build Coastguard Worker#
4*387f9dfdSAndroid Build Coastguard Worker#  LIBLZMA_FOUND - system has liblzma
5*387f9dfdSAndroid Build Coastguard Worker#  LIBLZMA_INCLUDE_DIRS - the liblzma include directory
6*387f9dfdSAndroid Build Coastguard Worker#  LIBLZMA_LIBRARIES - Link these to use liblzma
7*387f9dfdSAndroid Build Coastguard Worker
8*387f9dfdSAndroid Build Coastguard Workerif (LIBLZMA_LIBRARIES AND LIBLZMA_INCLUDE_DIRS)
9*387f9dfdSAndroid Build Coastguard Worker    set (LibLzma_FIND_QUIETLY TRUE)
10*387f9dfdSAndroid Build Coastguard Workerendif (LIBLZMA_LIBRARIES AND LIBLZMA_INCLUDE_DIRS)
11*387f9dfdSAndroid Build Coastguard Worker
12*387f9dfdSAndroid Build Coastguard Workerfind_path (LIBLZMA_INCLUDE_DIRS
13*387f9dfdSAndroid Build Coastguard Worker  NAMES
14*387f9dfdSAndroid Build Coastguard Worker    lzma.h
15*387f9dfdSAndroid Build Coastguard Worker  PATHS
16*387f9dfdSAndroid Build Coastguard Worker    /usr/include
17*387f9dfdSAndroid Build Coastguard Worker    /usr/local/include
18*387f9dfdSAndroid Build Coastguard Worker    /opt/local/include
19*387f9dfdSAndroid Build Coastguard Worker    /sw/include
20*387f9dfdSAndroid Build Coastguard Worker    ENV CPATH)
21*387f9dfdSAndroid Build Coastguard Worker
22*387f9dfdSAndroid Build Coastguard Workerfind_library (LIBLZMA_LIBRARIES
23*387f9dfdSAndroid Build Coastguard Worker  NAMES
24*387f9dfdSAndroid Build Coastguard Worker    lzma
25*387f9dfdSAndroid Build Coastguard Worker  PATHS
26*387f9dfdSAndroid Build Coastguard Worker    /usr/lib
27*387f9dfdSAndroid Build Coastguard Worker    /usr/local/lib
28*387f9dfdSAndroid Build Coastguard Worker    /opt/local/lib
29*387f9dfdSAndroid Build Coastguard Worker    /sw/lib
30*387f9dfdSAndroid Build Coastguard Worker    ENV LIBRARY_PATH
31*387f9dfdSAndroid Build Coastguard Worker    ENV LD_LIBRARY_PATH)
32*387f9dfdSAndroid Build Coastguard Worker
33*387f9dfdSAndroid Build Coastguard Workerinclude (FindPackageHandleStandardArgs)
34*387f9dfdSAndroid Build Coastguard Worker
35*387f9dfdSAndroid Build Coastguard Worker
36*387f9dfdSAndroid Build Coastguard Worker# handle the QUIETLY and REQUIRED arguments and set LIBLZMA_FOUND to TRUE if all listed variables are TRUE
37*387f9dfdSAndroid Build Coastguard WorkerFIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLzma DEFAULT_MSG
38*387f9dfdSAndroid Build Coastguard Worker  LIBLZMA_LIBRARIES
39*387f9dfdSAndroid Build Coastguard Worker  LIBLZMA_INCLUDE_DIRS)
40*387f9dfdSAndroid Build Coastguard Worker
41*387f9dfdSAndroid Build Coastguard Workerif (LIBLZMA_FOUND)
42*387f9dfdSAndroid Build Coastguard Worker  add_definitions(-DHAVE_LIBLZMA)
43*387f9dfdSAndroid Build Coastguard Workerendif (LIBLZMA_FOUND)
44*387f9dfdSAndroid Build Coastguard Worker
45*387f9dfdSAndroid Build Coastguard Workermark_as_advanced(LIBLZMA_INCLUDE_DIRS LIBLZMA_LIBRARIES)
46