1 # - Try to find QCA2 (Qt Cryptography Architecture 2)
2 # Once done this will define
4 # QCA2_FOUND - system has QCA2
5 # QCA2_INCLUDE_DIR - the QCA2 include directory
6 # QCA2_LIBRARIES - the libraries needed to use QCA2
7 # QCA2_DEFINITIONS - Compiler switches required for using QCA2
9 # use pkg-config to get the directories and then use these values
10 # in the FIND_PATH() and FIND_LIBRARY() calls
12 # Copyright (c) 2006, Michael Larouche, <michael.larouche@kdemail.net>
14 # Redistribution and use is allowed according to the terms of the BSD license.
15 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17 include(FindLibraryWithDebug)
19 if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
24 else (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
28 find_package(PkgConfig)
29 pkg_check_modules(PC_QCA2 QUIET qca2)
30 set(QCA2_DEFINITIONS ${PC_QCA2_CFLAGS_OTHER})
33 find_library(QCA2_LIBRARIES_DEBUG
35 HINTS ${PC_QCA2_LIBDIR} ${PC_QCA2_LIBRARY_DIRS}
37 find_library(QCA2_LIBRARIES_RELEASE
39 HINTS ${PC_QCA2_LIBDIR} ${PC_QCA2_LIBRARY_DIRS}
41 # if the release- as well as the debug-version of the library have been found:
42 IF (QCA2_LIBRARIES_DEBUG AND QCA2_LIBRARIES_RELEASE)
43 # if the generator supports configuration types then set
44 # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
45 IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
46 SET(QCA2_LIBRARIES optimized ${QCA2_LIBRARIES_RELEASE} debug ${QCA2_LIBRARIES_DEBUG})
47 ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
48 # if there are no configuration types and CMAKE_BUILD_TYPE has no value
49 # then just use the release libraries
50 SET(QCA2_LIBRARIES ${QCA2_LIBRARIES_RELEASE} )
51 ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
52 ELSE (QCA2_LIBRARIES_DEBUG AND QCA2_LIBRARIES_RELEASE)
53 IF (QCA2_LIBRARIES_RELEASE)
54 SET(QCA2_LIBRARIES ${QCA2_LIBRARIES_RELEASE})
55 ENDIF (QCA2_LIBRARIES_RELEASE)
56 ENDIF (QCA2_LIBRARIES_DEBUG AND QCA2_LIBRARIES_RELEASE)
59 find_path(QCA2_INCLUDE_DIR QtCrypto
60 HINTS ${PC_QCA2_INCLUDEDIR} ${PC_QCA2_INCLUDE_DIRS}
61 PATH_SUFFIXES QtCrypto)
63 include(FindPackageHandleStandardArgs)
64 find_package_handle_standard_args(QCA2 DEFAULT_MSG QCA2_LIBRARIES QCA2_INCLUDE_DIR)
66 mark_as_advanced(QCA2_INCLUDE_DIR QCA2_LIBRARIES)
68 endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)