From 76c875a699392f0187ebc4f42c67bb393de41fe2 Mon Sep 17 00:00:00 2001
From: Brad Hards <bradh@frogmouth.net>
Date: Sun, 9 Oct 2005 12:21:18 +0000
Subject: [PATCH] Add support for building the plugin without needing to
 install the QCA libraries first.

svn path=/trunk/kdesupport/qca/; revision=468858
---
 plugins/qca-openssl/qca.qcm | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/plugins/qca-openssl/qca.qcm b/plugins/qca-openssl/qca.qcm
index 193bfc23..ad751999 100644
--- a/plugins/qca-openssl/qca.qcm
+++ b/plugins/qca-openssl/qca.qcm
@@ -1,6 +1,7 @@
 /*
 -----BEGIN QCMOD-----
 name: QCA 2.0
+arg: in-tree-build,Build with uninstalled QCA, only useful for SVN users.
 -----END QCMOD-----
 */
 
@@ -16,11 +17,21 @@ public:
 	bool exec()
 	{
 		// test for "crypto" feature and check qca version number
+		QString arg;
+		arg = conf->getenv("QC_IN_TREE_BUILD");
 
-		QString proextra =
-		"CONFIG += qt crypto\n"
-		"QT -= gui\n";
-
+		QString proextra;
+		if (!arg.isEmpty()) {
+			proextra =
+			"CONFIG += qt \n"
+			"QT -= gui\n"
+			"INCLUDEPATH += ../../../../include/QtCrypto \n"
+			"LIBS += -L../../../../lib -lqca \n";
+		} else {
+			proextra =
+			"CONFIG += qt crypto\n"
+			"QT -= gui\n";
+		}
 		QString str =
 		"#include <QtCrypto>\n"
 		"\n"
@@ -35,7 +46,10 @@ public:
 			return false;
 		if(ret != 0)
 			return false;
-
+		if (!arg.isEmpty()) {
+			conf->addIncludePath("../../include/QtCrypto");
+			conf->addLib("-L../../lib -lqca");
+		}
 		return true;
 	}
 };