aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindMiniz.cmake
blob: 105cee4900e2521a3de3ec20d01e90b3d8b72ff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# This module tries to find miniz library and include files
#
# MINIZ_INCLUDE_DIR, path where to find miniz.h
# MINIZ_LIBRARY_DIR, path where to find libminiz.so
# MINIZ_LIBRARIES, the library to link against
# MINIZ_FOUND, If false, do not try to use miniz
#
# This currently works probably only for Linux

FIND_PATH ( MINIZ_INCLUDE_DIR miniz.h
    /usr/local/include
    /usr/include
)

FIND_LIBRARY ( MINIZ_LIBRARIES libminiz.so libminiz.a libminiz.so.2 libminiz.so.0.1
    /usr/local/lib
    /usr/local/lib64
    /usr/lib
    /usr/lib64
)

GET_FILENAME_COMPONENT( MINIZ_LIBRARY_DIR ${MINIZ_LIBRARIES} PATH )

SET ( MINIZ_FOUND "NO" )
IF ( MINIZ_INCLUDE_DIR )
    IF ( MINIZ_LIBRARIES )
        SET ( MINIZ_FOUND "YES" )
    ENDIF ( MINIZ_LIBRARIES )
ENDIF ( MINIZ_INCLUDE_DIR )

MARK_AS_ADVANCED(
    MINIZ_LIBRARY_DIR
    MINIZ_INCLUDE_DIR
    MINIZ_LIBRARIES
)