Bump bundled cmake files
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 1 Apr 2012 22:05:47 +0000 (00:05 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 1 Apr 2012 22:07:17 +0000 (00:07 +0200)
Mostly from KDE, plus a few fixes/modifications of our own.

cmake/modules/FindPackageHandleStandardArgs.cmake
cmake/modules/FindPhonon.cmake
cmake/modules/FindPkgConfig.cmake
cmake/modules/FindQCA2.cmake

index fe4345c..1152ce6 100644 (file)
@@ -1,24 +1,58 @@
-# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
-#    This macro is intended to be used in FindXXX.cmake modules files.
-#    It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
-#    it also sets the <UPPERCASED_NAME>_FOUND variable.
-#    The package is considered found if all variables listed are TRUE.
-#    The version-argument of FIND_PACKAGE() is also handled. 
-#    For checking whether the version is ok, this macro compares the 
-#    variable <UPPERCASED_NAME>_VERSION with the specified version.
-#    Example:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
 #
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
+# This function is intended to be used in FindXXX.cmake modules files.
+# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
+# It also sets the <UPPERCASED_NAME>_FOUND variable.
+# The package is considered found if all variables <var1>... listed contain
+# valid results, e.g. valid filepaths.
 #
-#    LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and 
-#    LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
-#    If it is not found and REQUIRED was used, it fails with FATAL_ERROR, 
-#    independent whether QUIET was used or not.
-#    If it is found, the location is reported using the VAR1 argument, so 
-#    here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
-#    If the second argument is DEFAULT_MSG, the message in the failure case will 
-#    be "Could NOT find LibXml2", if you don't like this message you can specify
-#    your own custom failure message there.
+# There are two modes of this function. The first argument in both modes is
+# the name of the Find-module where it is called (in original casing).
+#
+# The first simple mode looks like this:
+#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
+# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# If DEFAULT_MSG is given as second argument, then the function will generate
+# itself useful success and error messages. You can also supply a custom error message
+# for the failure case. This is not recommended.
+#
+# The second mode is more powerful and also supports version checking:
+#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
+#                                           [VERSION_VAR   <versionvar>
+#                                           [FAIL_MESSAGE "Custom failure message"] )
+#
+# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
+# used, the default message will be displayed.
+# Following VERSION_VAR the name of the variable can be specified which holds
+# the version of the package which has been found. If this is done, this version
+# will be checked against the (potentially) specified required version used
+# in the find_package() call. The EXACT keyword is also handled. The default
+# messages include information about the required version and the version
+# which has been actually found, both if the version is ok or not.
+#
+# Example for mode 1:
+#
+#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2  DEFAULT_MSG  LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+#
+# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
+# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
+# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
+# independent whether QUIET was used or not.
+# If it is found, success will be reported, including the content of <var1>.
+# On repeated Cmake runs, the same message won't be printed again.
+#
+# Example for mode 2:
+#
+#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON  REQUIRED_VARS BISON_EXECUTABLE
+#                                             VERSION_VAR BISON_VERSION)
+# In this case, BISON is considered to be found if the variable(s) listed
+# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
+# Also the version of BISON will be checked by using the version contained
+# in BISON_VERSION.
+# Since no FAIL_MESSAGE is given, the default messages will be printed.
 
 #=============================================================================
 # Copyright 2007-2009 Kitware, Inc.
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # See the License for more information.
 #=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
 INCLUDE(FindPackageMessage)
-FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
+INCLUDE(CMakeParseArguments)
+
+
+FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
+
+# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
+# new extended or in the "old" mode:
+  SET(options) # none
+  SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
+  SET(multiValueArgs REQUIRED_VARS)
+  SET(_KEYWORDS_FOR_EXTENDED_MODE  ${options} ${oneValueArgs} ${multiValueArgs} )
+  LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+  IF(${INDEX} EQUAL -1)
+    SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+    SET(FPHSA_REQUIRED_VARS ${_VAR1} ${ARGN})
+    SET(FPHSA_VERSION_VAR)
+  ELSE(${INDEX} EQUAL -1)
 
-  IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
-    SET(_FAIL_MESSAGE "Could NOT find ${_NAME}")
-  ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
-    SET(_FAIL_MESSAGE "${_FAIL_MSG}")
-  ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
+    CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${_VAR1} ${ARGN})
+
+    IF(FPHSA_UNPARSED_ARGUMENTS)
+      MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+    ENDIF(FPHSA_UNPARSED_ARGUMENTS)
+
+    IF(NOT FPHSA_FAIL_MESSAGE)
+      SET(FPHSA_FAIL_MESSAGE  "DEFAULT_MSG")
+    ENDIF(NOT FPHSA_FAIL_MESSAGE)
+  ENDIF(${INDEX} EQUAL -1)
+
+# now that we collected all arguments, process them
+
+  IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+    SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+  ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+
+  IF(NOT FPHSA_REQUIRED_VARS)
+    MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+  ENDIF(NOT FPHSA_REQUIRED_VARS)
+
+  LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
 
   STRING(TOUPPER ${_NAME} _NAME_UPPER)
 
-  # collect all variables which were not found, so they can be printed, so the 
+  # collect all variables which were not found, so they can be printed, so the
   # user knows better what went wrong (#6375)
   SET(MISSING_VARS "")
   SET(DETAILS "")
   SET(${_NAME_UPPER}_FOUND TRUE)
-  IF(NOT ${_VAR1})
-    SET(${_NAME_UPPER}_FOUND FALSE)
-    SET(MISSING_VARS " ${_VAR1}")
-  ELSE(NOT ${_VAR1})
-    SET(DETAILS "${DETAILS}[${${_VAR1}}]")
-  ENDIF(NOT ${_VAR1})
-
   # check if all passed variables are valid
-  FOREACH(_CURRENT_VAR ${ARGN})
+  FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
     IF(NOT ${_CURRENT_VAR})
       SET(${_NAME_UPPER}_FOUND FALSE)
       SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
@@ -66,6 +127,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
     ENDIF(NOT ${_CURRENT_VAR})
   ENDFOREACH(_CURRENT_VAR)
 
+
   # version handling:
   SET(VERSION_MSG "")
   SET(VERSION_OK TRUE)
@@ -73,36 +135,33 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
 
     # if the package was found, check for the version using <NAME>_FIND_VERSION
     IF (${_NAME_UPPER}_FOUND)
-      IF(${_NAME_UPPER}_VERSION)
-        SET(VERSION ${${_NAME_UPPER}_VERSION})
-      ELSEIF(${_NAME}_VERSION)
-        SET(VERSION ${${_NAME}_VERSION})
-      ENDIF(${_NAME_UPPER}_VERSION)
-      
-      IF(VERSION)  #hmm what do we do if the module in question doesn't set FOO_VERSION but something else ?... Ignore it for now
-
-      IF(${_NAME}_FIND_VERSION_EXACT)       # exact version required
-        IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-          SET(VERSION_MSG " Found version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
-          SET(VERSION_OK FALSE)
-        ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-          SET(VERSION_MSG " (found exact version \"${VERSION}\")")
-        ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-
-      ELSE(${_NAME}_FIND_VERSION_EXACT)     # minimum version specified:
-        IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-          SET(VERSION_MSG " Found version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
-          SET(VERSION_OK FALSE)
-        ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-          SET(VERSION_MSG " (found version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
-        ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-      ENDIF(${_NAME}_FIND_VERSION_EXACT)
-
-      ELSE(VERSION)
-        SET(VERSION_MSG " (WARNING: Required version is \"${${_NAME}_FIND_VERSION}\", but version of ${_NAME} is unknown)")
+      SET(VERSION ${${FPHSA_VERSION_VAR}} )
+
+      IF(VERSION)
+
+        IF(${_NAME}_FIND_VERSION_EXACT)       # exact version required
+          IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+            SET(VERSION_MSG " Found version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+            SET(VERSION_OK FALSE)
+          ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+            SET(VERSION_MSG " (found exact version \"${VERSION}\")")
+          ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+
+        ELSE(${_NAME}_FIND_VERSION_EXACT)     # minimum version specified:
+          IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+            SET(VERSION_MSG " Found version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+            SET(VERSION_OK FALSE)
+          ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+            SET(VERSION_MSG " (found version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
+          ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+        ENDIF(${_NAME}_FIND_VERSION_EXACT)
+
+# Uncomment the following two lines to see to which Find-modules the VERSION_VAR keywords still need to be added:
+#      ELSE(VERSION)
+#        SET(VERSION_MSG " (WARNING: Required version is \"${${_NAME}_FIND_VERSION}\", but version of ${_NAME} is unknown)")
       ENDIF(VERSION)
 
-    # if the package was not found, but some a version was given, add that to the output:
+    # if the package was not found, but a version was given, add that to the output:
     ELSE (${_NAME_UPPER}_FOUND)
       IF(${_NAME}_FIND_VERSION_EXACT)
          SET(VERSION_MSG " (Required is exact version \"${${_NAME}_FIND_VERSION}\")")
@@ -113,7 +172,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
   ENDIF (${_NAME}_FIND_VERSION)
 
   IF(VERSION_OK)
-      SET(DETAILS "${DETAILS}[v${${VERSION}}]")
+    SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
   ELSE(VERSION_OK)
     SET(${_NAME_UPPER}_FOUND FALSE)
   ENDIF(VERSION_OK)
@@ -121,25 +180,25 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
 
   # print the result:
   IF (${_NAME_UPPER}_FOUND)
-    FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_VAR1}} ${VERSION_MSG}" "${DETAILS}")
+    FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
   ELSE (${_NAME_UPPER}_FOUND)
     IF(NOT VERSION_OK)
 
       IF (${_NAME}_FIND_REQUIRED)
-          MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_VAR1}})")
+          MESSAGE(FATAL_ERROR "${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
       ELSE (${_NAME}_FIND_REQUIRED)
         IF (NOT ${_NAME}_FIND_QUIETLY)
-          MESSAGE(STATUS "${_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_VAR1}})")
+          MESSAGE(STATUS "${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
         ENDIF (NOT ${_NAME}_FIND_QUIETLY)
       ENDIF (${_NAME}_FIND_REQUIRED)
 
     ELSE(NOT VERSION_OK)
 
       IF (${_NAME}_FIND_REQUIRED)
-          MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+          MESSAGE(FATAL_ERROR "${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
       ELSE (${_NAME}_FIND_REQUIRED)
         IF (NOT ${_NAME}_FIND_QUIETLY)
-          MESSAGE(STATUS "${_FAIL_MESSAGE}  (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+          MESSAGE(STATUS "${FPHSA_FAIL_MESSAGE}  (missing: ${MISSING_VARS}) ${VERSION_MSG}")
         ENDIF (NOT ${_NAME}_FIND_QUIETLY)
       ENDIF (${_NAME}_FIND_REQUIRED)
     ENDIF(NOT VERSION_OK)
@@ -148,4 +207,4 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
 
   SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
 
-ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
+ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
index e4355d0..ab0a86c 100644 (file)
@@ -30,12 +30,8 @@ else(PHONON_FOUND)
       set(PHONON_FIND_QUIETLY TRUE)
    endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
 
-   # As discussed on kde-buildsystem: first look at CMAKE_PREFIX_PATH, then at the suggested PATHS (kde4 install dir)
-   find_library(PHONON_LIBRARY_RELEASE NAMES phonon phonon4 PATHS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
-   find_library(PHONON_LIBRARY_DEBUG NAMES phonond phonond4 PATHS ${KD4_LIB_INSTALL} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
-   # then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.)
-   find_library(PHONON_LIBRARY_RELEASE NAMES phonon phonon4)
-   find_library(PHONON_LIBRARY_DEBUG NAMES phonond phonond4)
+   find_library(PHONON_LIBRARY_RELEASE NAMES phonon phonon4 HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
+   find_library(PHONON_LIBRARY_DEBUG NAMES phonond phonond4 HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
 
    # if the release- as well as the debug-version of the library have been found:
    IF (PHONON_LIBRARY_DEBUG AND PHONON_LIBRARY_RELEASE)
@@ -54,8 +50,7 @@ else(PHONON_FOUND)
      ENDIF (PHONON_LIBRARY_RELEASE)
    ENDIF (PHONON_LIBRARY_DEBUG AND PHONON_LIBRARY_RELEASE)
 
-   find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
-   find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h)
+   find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
 
    if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
       set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
@@ -66,25 +61,8 @@ else(PHONON_FOUND)
       set(PHONON_FOUND FALSE)
    endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
 
-   if(PHONON_FOUND)
-      if(NOT PHONON_FIND_QUIETLY)
-         message(STATUS "Found Phonon: ${PHONON_LIBRARY}")
-         message(STATUS "Found Phonon Includes: ${PHONON_INCLUDES}")
-      endif(NOT PHONON_FIND_QUIETLY)
-   else(PHONON_FOUND)
-      if(Phonon_FIND_REQUIRED)
-         if(NOT PHONON_INCLUDE_DIR)
-            message(STATUS "Phonon includes NOT found!")
-         endif(NOT PHONON_INCLUDE_DIR)
-         if(NOT PHONON_LIBRARY)
-            message(STATUS "Phonon library NOT found!")
-         endif(NOT PHONON_LIBRARY)
-         message(FATAL_ERROR "Phonon library or includes NOT found!")
-      else(Phonon_FIND_REQUIRED)
-         message(STATUS "Unable to find Phonon")
-      endif(Phonon_FIND_REQUIRED)
-   endif(PHONON_FOUND)
+   include(FindPackageHandleStandardArgs)
+   find_package_handle_standard_args(Phonon  DEFAULT_MSG  PHONON_INCLUDE_DIR PHONON_LIBRARY)
 
-
-   mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY PHONON_INCLUDES)
+   mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY)
 endif(PHONON_FOUND)
index 8436763..78c4a13 100644 (file)
 #
 # Redistribution and use, with or without modification, are permitted
 # provided that the following conditions are met:
-# 
+#
 #    1. Redistributions must retain the above copyright notice, this
 #       list of conditions and the following disclaimer.
 #    2. The name of the author may not be used to endorse or promote
 #       products derived from this software without specific prior
 #       written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
-
-
 ### Common stuff ####
 set(PKG_CONFIG_VERSION 1)
 set(PKG_CONFIG_FOUND   0)
@@ -162,7 +160,7 @@ endmacro(_pkgconfig_invoke_dyn)
 macro(_pkgconfig_parse_options _result _is_req _is_silent)
   set(${_is_req} 0)
   set(${_is_silent} 0)
-  
+
   foreach(_pkg ${ARGN})
     if (_pkg STREQUAL "REQUIRED")
       set(${_is_req} 1)
@@ -213,7 +211,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
         message(STATUS "checking for modules '${_pkg_check_modules_list}'")
       endif(_pkg_check_modules_cnt EQUAL 1)
     endif(NOT ${_is_silent})
-    
+
     set(_pkg_check_modules_packages)
     set(_pkg_check_modules_failed)
 
@@ -240,14 +238,14 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
       if (_pkg_check_modules_pkg_op STREQUAL "=")
         list(APPEND _pkg_check_modules_exist_query --exact-version)
       endif(_pkg_check_modules_pkg_op STREQUAL "=")
-      
+
       if (_pkg_check_modules_pkg_op STREQUAL "<=")
         list(APPEND _pkg_check_modules_exist_query --max-version)
       endif(_pkg_check_modules_pkg_op STREQUAL "<=")
 
       # create the final query which is of the format:
       # * --atleast-version <version> <pkg-name>
-      # * --exact-version <version> <pkg-name>      
+      # * --exact-version <version> <pkg-name>
       # * --max-version <version> <pkg-name>
       # * --exists <pkg-name>
       if (_pkg_check_modules_pkg_op)
@@ -287,7 +285,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
     else(_pkg_check_modules_failed)
       # when we are here, we checked whether requested modules
       # exist. Now, go through them and set variables
-      
+
       _pkgconfig_set(${_prefix}_FOUND 1)
       list(LENGTH _pkg_check_modules_packages pkg_count)
 
@@ -299,7 +297,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
         else(pkg_count EQUAL 1)
           set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}")
         endif(pkg_count EQUAL 1)
-        
+
         _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION    ""   --modversion )
         _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX     ""   --variable=prefix )
         _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR ""   --variable=includedir )
@@ -369,9 +367,9 @@ macro(pkg_search_module _prefix _module0)
         message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
       endif(${_pkg_is_required})
     endif(NOT ${_prefix}_FOUND)
-    
+
     _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
-  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)  
+  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
 endmacro(pkg_search_module)
 
 ### Local Variables:
index 04a5091..cf000e4 100644 (file)
@@ -56,12 +56,12 @@ else (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
   ENDIF (QCA2_LIBRARIES_DEBUG AND QCA2_LIBRARIES_RELEASE)
 
 
-  find_path(QCA2_INCLUDE_DIR qca.h
+  find_path(QCA2_INCLUDE_DIR QtCrypto
             HINTS ${PC_QCA2_INCLUDEDIR} ${PC_QCA2_INCLUDE_DIRS}
             PATH_SUFFIXES QtCrypto)
 
   include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(QCA2 QCA2_LIBRARIES QCA2_INCLUDE_DIR)
+  find_package_handle_standard_args(QCA2  DEFAULT_MSG  QCA2_LIBRARIES QCA2_INCLUDE_DIR)
 
   mark_as_advanced(QCA2_INCLUDE_DIR QCA2_LIBRARIES)