File: FindLIBCERF.cmake

package info (click to toggle)
labplot 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,500 kB
  • sloc: cpp: 241,048; ansic: 6,324; python: 915; xml: 400; yacc: 237; sh: 221; awk: 35; makefile: 11
file content (48 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download | duplicates (3)
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
41
42
43
44
45
46
47
48
#=============================================================================
# SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#=============================================================================

find_package(PkgConfig QUIET)
pkg_check_modules(PC_LIBCERF libcerf QUIET)

find_library(LIBCERF_LIBRARIES
    NAMES cerf
    HINTS ${PC_LIBCERF_LIBRARY_DIRS}
)

find_path(LIBCERF_INCLUDE_DIR
    NAMES cerf.h
    HINTS ${PC_LIBCERF_INCLUDE_DIRS}
)

set(LIBCERF_VERSION ${PC_LIBCERF_VERSION})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBCERF
    REQUIRED_VARS
        LIBCERF_LIBRARIES
        LIBCERF_INCLUDE_DIR
    VERSION_VAR
        LIBCERF_VERSION
)

if(LIBCERF_FOUND AND NOT TARGET libcerf::libcerf)
    add_library(libcerf::libcerf UNKNOWN IMPORTED)
    set_target_properties(libcerf::libcerf PROPERTIES
	 IMPORTED_LOCATION "${LIBCERF_LIBRARIES}"
         INTERFACE_COMPILE_OPTIONS "${PC_LIBCERF_CFLAGS}"
         INTERFACE_INCLUDE_DIRECTORIES "${LIBCERF_INCLUDE_DIR}"
    )
else()
	set(LIBCERF_LIBRARIES "")
endif()

mark_as_advanced(LIBCERF_LIBRARIES LIBCERF_INCLUDE_DIR LIBCERF_VERSION)

include(FeatureSummary)
set_package_properties(LIBCERF PROPERTIES
    DESCRIPTION "Efficient and accurate implementation of complex error functions, along with Dawson, Faddeeva, and Voigt functions"
    URL "https://jugit.fz-juelich.de/mlz/libcerf"
)