qt4-b-gone: Remove support for libindicate
[quassel.git] / cmake / FindQCA2-QT5.cmake
1 # - Try to find QCA2 (Qt Cryptography Architecture 2) for QT5
2 # Once done this will define
3 #
4 #  QCA2-QT5_FOUND - system has QCA2-QT5
5 #  QCA2-QT5_INCLUDE_DIR - the QCA2-QT5 include directory
6 #  QCA2-QT5_LIBRARIES - the libraries needed to use QCA2-QT5
7 #  QCA2-QT5_DEFINITIONS - Compiler switches required for using QCA2-QT5
8 #
9 # use pkg-config to get the directories and then use these values
10 # in the FIND_PATH() and FIND_LIBRARY() calls
11
12 # Copyright (c) 2006, Michael Larouche, <michael.larouche@kdemail.net>
13 #
14 # Redistribution and use is allowed according to the terms of the BSD license.
15 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
16
17 include(FindPackageHandleStandardArgs)
18
19 find_package(Qca-qt5 QUIET)
20 if(Qca-qt5_FOUND)
21
22   set(QCA2-QT5_INCLUDE_DIR ${CMAKE_PREFIX_PATH}/include)#just to have any value as the real include dir is imported by linking to qca-qt5
23   set(QCA2-QT5_LIBRARIES qca-qt5)
24
25   find_package_handle_standard_args(QCA2-QT5 DEFAULT_MSG QCA2-QT5_LIBRARIES QCA2-QT5_INCLUDE_DIR)
26
27   mark_as_advanced(QCA2-QT5_INCLUDE_DIR QCA2-QT5_LIBRARIES)
28 else()
29
30 include(FindLibraryWithDebug)
31
32 if (QCA2-QT5_INCLUDE_DIR AND QCA2-QT5_LIBRARIES)
33
34   # in cache already
35   set(QCA2-QT5_FOUND TRUE)
36
37 else()
38
39
40   if (NOT WIN32)
41     find_package(PkgConfig)
42     pkg_check_modules(PC_QCA2-QT5 QUIET qca2-qt5)
43     set(QCA2-QT5_DEFINITIONS ${PC_QCA2-QT5_CFLAGS_OTHER})
44   endif()
45
46   find_library_with_debug(QCA2-QT5_LIBRARIES
47                   WIN32_DEBUG_POSTFIX d
48                   NAMES qca-qt5
49                   HINTS ${PC_QCA2-QT5_LIBDIR} ${PC_QCA2-QT5_LIBRARY_DIRS}
50                   )
51
52   find_path(QCA2-QT5_INCLUDE_DIR QtCrypto
53             HINTS ${PC_QCA2-QT5_INCLUDEDIR} ${PC_QCA2-QT5_INCLUDE_DIRS}
54             PATH_SUFFIXES QtCrypto)
55
56   find_package_handle_standard_args(QCA2-QT5 DEFAULT_MSG QCA2-QT5_LIBRARIES QCA2-QT5_INCLUDE_DIR)
57
58   mark_as_advanced(QCA2-QT5_INCLUDE_DIR QCA2-QT5_LIBRARIES)
59
60 endif()
61 endif()