Campbell Barton 6c644b
Campbell Barton 6c644b
if(WITH_SYSTEM_LZO)
Campbell Barton 6c644b
    # depend on CMake's defaults
Campbell Barton 6c644b
    set(_header_hints)
Campbell Barton 6c644b
    set(_header_suffixes
Campbell Barton 6c644b
        lzo
Campbell Barton 6c644b
    )
Campbell Barton 6c644b
    set(_lib_suffixes)
Campbell Barton 6c644b
else()
Campbell Barton 6c644b
    set(_header_hints
Campbell Barton 6c644b
        ${THIRDPARTY_LIBS_HINTS}
Campbell Barton 6c644b
    )
Campbell Barton 6c644b
    set(_header_suffixes
Campbell Barton 6c644b
        lzo/2.09/include/lzo
Campbell Barton 6c644b
        lzo/2.03/include/lzo
Campbell Barton 6c644b
    )
Campbell Barton 6c644b
    set(_lib_hints
Campbell Barton 6c644b
        ${THIRDPARTY_LIBS_HINTS}
Campbell Barton 6c644b
    )
Campbell Barton 6c644b
    set(_lib_suffixes
Campbell Barton 6c644b
        lzo/2.09/lib
Campbell Barton 6c644b
        lzo/2.03/lib/LZO_lib
Campbell Barton 6c644b
    )
Campbell Barton 6c644b
endif()
Campbell Barton 6c644b
Campbell Barton 7aaaec
find_path(
Campbell Barton 7aaaec
    LZO_INCLUDE_DIR
Campbell Barton 7aaaec
    NAMES
Campbell Barton 7aaaec
        lzoconf.h
Campbell Barton 7aaaec
    HINTS
Campbell Barton 6c644b
        ${_header_hints}
Campbell Barton 7aaaec
    PATH_SUFFIXES
Campbell Barton 6c644b
        ${_header_suffixes}
Campbell Barton 7aaaec
)
Campbell Barton 7aaaec
Campbell Barton ac30fb
# List dynamic library 'so' first
Campbell Barton ac30fb
# since static has issues on some systems, see: #866
Campbell Barton 7aaaec
find_library(
Campbell Barton 7aaaec
    LZO_LIBRARY
Campbell Barton 7aaaec
    NAMES
Campbell Barton ac30fb
        liblzo2.so
Campbell Barton 7aaaec
        liblzo2.a
Campbell Barton 7aaaec
        lzo2_64.lib
Campbell Barton 7aaaec
    HINTS
Campbell Barton 6c644b
        ${_lib_hints}
Campbell Barton 7aaaec
    PATH_SUFFIXES
Campbell Barton 6c644b
        ${_lib_suffixes}
Campbell Barton 7aaaec
)
roentgen 3969d9
roentgen 3969d9
message("***** LZO Header path:" ${LZO_INCLUDE_DIR})
Campbell Barton bf80fb
message("***** LZO Library path:" ${LZO_LIBRARY})
roentgen 3969d9
roentgen 3969d9
set(LZO_NAMES ${LZO_NAMES} LZO)
roentgen 3969d9
roentgen 3969d9
include(FindPackageHandleStandardArgs)
Campbell Barton 7aaaec
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO
Campbell Barton 7aaaec
    DEFAULT_MSG LZO_LIBRARY LZO_INCLUDE_DIR)
roentgen 3969d9
roentgen 3969d9
if(LZO_FOUND)
roentgen 3969d9
    set(LZO_LIBRARIES ${LZO_LIBRARY})
roentgen 3969d9
endif()
roentgen 3969d9
Campbell Barton 7aaaec
mark_as_advanced(
Campbell Barton 7aaaec
    LZO_LIBRARY
Campbell Barton 7aaaec
    LZO_INCLUDE_DIR
Campbell Barton 7aaaec
)
Campbell Barton 6c644b
Campbell Barton 6c644b
unset(_header_hints)
Campbell Barton 6c644b
unset(_header_suffixes)
Campbell Barton 6c644b
unset(_lib_hints)
Campbell Barton 6c644b
unset(_lib_suffixes)