File: FindQalculate.cmake

package info (click to toggle)
cantor 4%3A16.08.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,300 kB
  • sloc: cpp: 24,077; xml: 2,109; lisp: 52; python: 37; makefile: 15; sh: 11
file content (75 lines) | stat: -rw-r--r-- 1,881 bytes parent folder | download
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# - Try to find libqalculate
# Input variables
#
#  QALCULATE_MIN_VERSION - minimal version of libqalculate
#  QALCULATE_FIND_REQUIRED - fail if can't find libqalculate
#
# Once done this will define
#
#  QALCULATE_FOUND - system has libqalculate
#  QALCULATE_CFLAGS - libqalculate cflags
#  QALCULATE_LIBRARIES - libqalculate libraries
#
# Copyright (c) 2007, Vladimir Kuznetsov, <ks.vladimir@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if(QALCULATE_CFLAGS AND QALCULATE_LIBRARIES)

  # in cache already
  set(QALCULATE_FOUND TRUE)

else(QALCULATE_CFLAGS AND QALCULATE_LIBRARIES)
  if(NOT WIN32)
    include(FindPkgConfig)

    if(QALCULATE_MIN_VERSION)
      pkg_check_modules(_pc_QALCULATE libqalculate>=${QALCULATE_MIN_VERSION})
    else(QALCULATE_MIN_VERSION)
      pkg_check_modules(_pc_QALCULATE libqalculate)
    endif(QALCULATE_MIN_VERSION)

    pkg_check_modules(_pc_CLN cln)

    if(_pc_QALCULATE_FOUND)
      set(QALCULATE_CFLAGS ${_pc_QALCULATE_CFLAGS})
    endif(_pc_QALCULATE_FOUND)

    find_library(QALCULATE_LIBRARIES
      NAMES
      qalculate
      PATHS
      ${_pc_QALCULATE_LIBRARY_DIRS}
      ${LIB_INSTALL_DIR}
    )

    find_path(QALCULATE_INCLUDE_DIR
      NAMES
      libqalculate
      PATHS
      ${_pc_QALCULATE_INCLUDE_DIRS}
      ${INCLUDE_INSTALL_DIR}
    )

    find_library(CLN_LIBRARIES
      NAMES
      cln
      PATHS
      ${_pc_CLN_LIBRARY_DIRS}
      ${LIB_INSTALL_DIR}
    )

  else(NOT WIN32)
    # XXX: currently no libqalculate on windows
    set(QALCULATE_FOUND FALSE)

  endif(NOT WIN32)

  include(FindPackageHandleStandardArgs)
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qalculate DEFAULT_MSG QALCULATE_LIBRARIES )

  mark_as_advanced(QALCULATE_CFLAGS QALCULATE_LIBRARIES)

endif(QALCULATE_CFLAGS AND QALCULATE_LIBRARIES)