Index: FindQCA2.cmake
===================================================================
--- FindQCA2.cmake	(revision 608292)
+++ FindQCA2.cmake	(working copy)
@@ -14,42 +14,49 @@
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
+if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
 
+  # in cache allready
+  set(QCA2_FOUND TRUE)  
 
-INCLUDE(UsePkgConfig)
-IF (NOT WIN32)
-PKGCONFIG(qca _Qca2IncDir _Qca2LinkDir _Qca2LinkFlags _Qca2Cflags)
+else (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
 
-MESSAGE(STATUS "pkg-config returned ${_Qca2IncDir} for QCA 2 includes")
-set(QCA2_DEFINITIONS ${_Qca2Cflags})
+  INCLUDE(UsePkgConfig)
 
-set(QCA2_INCLUDE_DIR ${_Qca2IncDir})
-ENDIF (NOT WIN32)
-#FIND_PATH(QCA2_INCLUDE_DIR QtCrypto
-#  PATHS
-# ${_Qca2IncDir}
-#)
+  IF (NOT WIN32)
+    PKGCONFIG(qca _Qca2IncDir _Qca2LinkDir _Qca2LinkFlags _Qca2Cflags)
 
-MESSAGE(STATUS "QCA2_INCLUDE_DIR has value ${QCA2_INCLUDE_DIR}" )
+    MESSAGE(STATUS "pkg-config returned ${_Qca2IncDir} for QCA 2 includes")
+    set(QCA2_DEFINITIONS ${_Qca2Cflags})
+  ENDIF (NOT WIN32)
 
-FIND_LIBRARY(QCA2_LIBRARIES NAMES qca
-  PATHS
-  ${_Qca2LinkDir} 
-  NO_DEFAULT_PATH 
-)
+  FIND_PATH(QCA2_INCLUDE_DIR QtCrypto
+    PATHS
+    ${_Qca2IncDir}
+    )
 
-if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
-   set(QCA2_FOUND TRUE)
-endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+  MESSAGE(STATUS "QCA2_INCLUDE_DIR has value ${QCA2_INCLUDE_DIR}" )
 
-if (QCA2_FOUND)
-  if (NOT QCA2_FIND_QUIETLY)
-    message(STATUS "Found QCA2: ${QCA2_LIBRARIES}")
-  endif (NOT QCA2_FIND_QUIETLY)
-else (QCA2_FOUND)
-  if (QCA2_FIND_REQUIRED)
-    message(SEND_ERROR "Could NOT find QCA2")
-  endif (QCA2_FIND_REQUIRED)
-endif (QCA2_FOUND)
+  FIND_LIBRARY(QCA2_LIBRARIES NAMES qca
+    PATHS
+    ${_Qca2LinkDir} 
+    NO_DEFAULT_PATH 
+  )
 
-MARK_AS_ADVANCED(QCA2_INCLUDE_DIR QCA2_LIBRARIES)
+  if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+    set(QCA2_FOUND TRUE)
+  endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+
+  if (QCA2_FOUND)
+    if (NOT QCA2_FIND_QUIETLY)
+      message(STATUS "Found QCA2: ${QCA2_LIBRARIES}")
+    endif (NOT QCA2_FIND_QUIETLY)
+  else (QCA2_FOUND)
+    if (QCA2_FIND_REQUIRED)
+      message(SEND_ERROR "Could NOT find QCA2")
+    endif (QCA2_FIND_REQUIRED)
+  endif (QCA2_FOUND)
+
+  MARK_AS_ADVANCED(QCA2_INCLUDE_DIR QCA2_LIBRARIES)
+
+endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
