File: FindCODA.cmake

package info (click to toggle)
harp 1.5%2Bdata-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 54,032 kB
  • sloc: xml: 286,510; ansic: 143,710; yacc: 1,910; python: 913; makefile: 600; lex: 574; sh: 69
file content (40 lines) | stat: -rw-r--r-- 1,326 bytes parent folder | download | duplicates (5)
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 CODA library
#
# This module defines
# CODA_INCLUDE_DIR, where to find coda.h
# CODA_LIBRARIES, the coda libraries to link against to use CODA.
# CODA_FOUND, If false, do not try to use CODA.
#
# The user may specify CODA_INCLUDE_DIR and CODA_LIBRARY_DIR variables
# to locate include and library files
#
include(CheckLibraryExists)
include(CheckIncludeFile)

set(CODA_INCLUDE_DIR CACHE STRING "Location of CODA include files")
set(CODA_LIBRARY_DIR CACHE STRING "Location of CODA library files")

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

check_include_file(coda.h HAVE_CODA_H)

find_library(CODA_LIBRARY NAMES coda libcoda PATHS ${CODA_LIBRARY_DIR})
if(CODA_LIBRARY)
  check_library_exists(${CODA_LIBRARY} coda_init "" HAVE_CODA_LIBRARY)
endif(CODA_LIBRARY)
if(HAVE_CODA_LIBRARY)
  set(CODA_LIBRARIES ${CODA_LIBRARY})
endif(HAVE_CODA_LIBRARY)

if(WIN32 AND HAVE_CODA_LIBRARY)
get_filename_component(CODA_LIBRARY_NAME ${CODA_LIBRARY} NAME_WE)
find_file(CODA_DLL NAMES ${CODA_LIBRARY_NAME}.dll PATHS ${CODA_LIBRARY_DIR} ${CODA_LIBRARY_DIR}/../bin)
if(CODA_DLL)
set(CODA_DLLS ${CODA_DLL})
endif(CODA_DLL)
endif(WIN32 AND HAVE_CODA_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CODA DEFAULT_MSG HAVE_CODA_LIBRARY HAVE_CODA_H)