cmake_modules/FindQCA2.cmake
author unc0rr
Wed, 25 Feb 2009 17:36:02 +0000
changeset 1843 16cdd1745b73
permissions -rw-r--r--
Add QCA2 checks to build system
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1843
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     1
# - Try to find QCA2 (Qt Cryptography Architecture 2)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     2
# Once done this will define
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     3
#
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     4
#  QCA2_FOUND - system has QCA2
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     5
#  QCA2_INCLUDE_DIR - the QCA2 include directory
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     6
#  QCA2_LIBRARIES - the libraries needed to use QCA2
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     7
#  QCA2_DEFINITIONS - Compiler switches required for using QCA2
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     8
#
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
     9
# use pkg-config to get the directories and then use these values
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    10
# in the FIND_PATH() and FIND_LIBRARY() calls
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    11
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    12
# Copyright (c) 2006, Michael Larouche, <michael.larouche@kdemail.net>
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    13
#
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    14
# Redistribution and use is allowed according to the terms of the BSD license.
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    15
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    16
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    17
include(FindLibraryWithDebug)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    18
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    19
if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    20
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    21
  # in cache already
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    22
  set(QCA2_FOUND TRUE)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    23
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    24
else (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    25
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    26
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    27
  if (NOT WIN32)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    28
    find_package(PkgConfig)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    29
    pkg_check_modules(PC_QCA2 qca2)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    30
    set(QCA2_DEFINITIONS ${PC_QCA2_CFLAGS_OTHER})
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    31
  endif (NOT WIN32)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    32
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    33
  find_library_with_debug(QCA2_LIBRARIES
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    34
                  WIN32_DEBUG_POSTFIX d
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    35
                  NAMES qca
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    36
                  HINTS ${PC_QCA2_LIBDIR} ${PC_QCA2_LIBRARY_DIRS}
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    37
                  )
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    38
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    39
  find_path(QCA2_INCLUDE_DIR qca.h 
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    40
            HINTS ${PC_QCA2_INCLUDEDIR} ${PC_QCA2_INCLUDE_DIRS}
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    41
            PATH_SUFFIXES QtCrypto)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    42
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    43
  include(FindPackageHandleStandardArgs)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    44
  find_package_handle_standard_args(QCA2  DEFAULT_MSG  QCA2_LIBRARIES QCA2_INCLUDE_DIR)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    45
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    46
  mark_as_advanced(QCA2_INCLUDE_DIR QCA2_LIBRARIES)
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    47
16cdd1745b73 Add QCA2 checks to build system
unc0rr
parents:
diff changeset
    48
endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)