File: FindSZIP.cmake

package info (click to toggle)
coda 2.21.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,320 kB
  • sloc: ansic: 125,785; javascript: 6,732; java: 2,391; yacc: 1,007; python: 872; makefile: 615; lex: 204; sh: 99; fortran: 60; xml: 5
file content (40 lines) | stat: -rw-r--r-- 1,326 bytes parent folder | download | duplicates (6)
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
36
37
38
39
40
# Find the SZIP library
#
# This module defines
# SZIP_INCLUDE_DIR, where to find szip.h
# SZIP_LIBRARIES, the libraries to link against to use SZIP.
# SZIP_FOUND, If false, do not try to use SZIP
#
# The user may specify SZIP_INCLUDE_DIR and SZIP_LIBRARY_DIR variables
# to locate include and library files
#
include(CheckLibraryExists)
include(CheckIncludeFile)

set(SZIP_INCLUDE_DIR CACHE STRING "Location of SZIP include files")
set(SZIP_LIBRARY_DIR CACHE STRING "Location of SZIP library files")

if(SZIP_INCLUDE_DIR)
  set(CMAKE_REQUIRED_INCLUDES ${SZIP_INCLUDE_DIR})
endif(SZIP_INCLUDE_DIR)

check_include_file(szlib.h HAVE_SZIP_H)

find_library(SZIP_LIBRARY NAMES sz szip libszip PATHS ${SZIP_LIBRARY_DIR})
if(SZIP_LIBRARY)
  check_library_exists(${SZIP_LIBRARY} SZ_Compress "" HAVE_SZIP_LIBRARY)
endif(SZIP_LIBRARY)
if(HAVE_SZIP_LIBRARY)
  set(SZIP_LIBRARIES ${SZIP_LIBRARY})
endif(HAVE_SZIP_LIBRARY)

if(WIN32 AND HAVE_SZIP_LIBRARY)
get_filename_component(SZIP_LIBRARY_NAME ${SZIP_LIBRARY} NAME_WE)
find_file(SZIP_DLL NAMES ${SZIP_LIBRARY_NAME}.dll PATHS ${SZIP_LIBRARY_DIR} ${SZIP_LIBRARY_DIR}/../bin)
if(SZIP_DLL)
set(SZIP_DLLS ${SZIP_DLL})
endif(SZIP_DLL)
endif(WIN32 AND HAVE_SZIP_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SZIP DEFAULT_MSG HAVE_SZIP_LIBRARY HAVE_SZIP_H)