File: FindPkcs11Helper.cmake

package info (click to toggle)
qca2 2.3.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,888 kB
  • sloc: cpp: 59,224; ansic: 814; perl: 133; sh: 89; makefile: 34
file content (40 lines) | stat: -rw-r--r-- 1,156 bytes parent folder | download | duplicates (4)
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
# - Try to find the pkcs11-helper library
# Once done this will define
#
#  PKCS11H_FOUND - system has pkcs11-helper 
#  PKCS11H_INCLUDE_DIRS - the pkcs11-helper include directories
#  PKCS11H_LDFLAGS - Link to these to use pkcs11-helper
#  PKCS11H_CFLAGS_OTHER - Compiler switches required for using pkcs11-helper
#
# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# pkcs11-helper can be found at http://www.opensc-project.org/pkcs11-helper
#

if(PKCS11H_INCLUDE_DIRS AND PKCS11H_LDFLAGS)

  # in cache already
  SET(PKCS11H_FOUND TRUE)

else()
  if(NOT WIN32)
    find_package(PkgConfig)
    pkg_search_module(PKCS11H libpkcs11-helper-1)
  endif()

  if (PKCS11H_FOUND)
    if (NOT Pkcs11Helper_FIND_QUIETLY)
      message(STATUS "Found pkcs11-helper: ${PKCS11H_LDFLAGS}")
    endif()
  else()
    if (Pkcs11Helper_FIND_REQUIRED)
      message(FATAL_ERROR "Could NOT find pkcs11-helper")
    endif()
  endif()
  
  mark_as_advanced(PKCS11H_INCLUDE_DIRS PKCS11H_LDFLAGS PKCS11H_CFLAGS_OTHER)
  
endif()