#include <QApplication>
#include <QtGui>
#include <QtCore>
#include <QDebug>

int main (int argc, char *argv[])
{
	QApplication a(argc,argv);
	const QString path = qApp->applicationDirPath();
	const QString pathRecetteDialog = path+"/../src/comptabilite_interfaces_src/recettedialog";
	qDebug() << __FILE__ << QString::number(__LINE__) << " pathRecetteDialog =" << pathRecetteDialog ;
	const QString pathDepenseDialog = path+"/../src/comptabilite_interfaces_src/depensedialog";
	const QString pathComptatriee = path+"/../src/recettestriees/comptatriee";
	QString qmake ;
	#ifndef LINUX
	qmake = "/usr/bin/qmake-qt4 ";
	#endif
	qDebug() << __FILE__ << QString::number(__LINE__) << " qmake =" << qmake ;
	QProcess procRecetteDialog;
	procRecetteDialog.start(qmake + pathRecetteDialog + "/recettedialog.pro -o "+ pathRecetteDialog +"/Makefile");
	qDebug() << __FILE__ << QString::number(__LINE__) << qmake + pathRecetteDialog + "/recettedialog.pro -o "+ pathRecetteDialog +"/Makefile"; ;
	QProcess procDepenseDialog;
	procDepenseDialog.start(qmake + pathDepenseDialog +"/depensedialog.pro -o " +pathDepenseDialog + "/Makefile");
	QProcess procComptatriee;
	procComptatriee.start(qmake + pathComptatriee + "/comptatriee.pro -o " + pathComptatriee + "/Makefile");
	
	qDebug() << __FILE__ << QString::number(__LINE__) << " result =" << procRecetteDialog.errorString() ;
	qDebug() << __FILE__ << QString::number(__LINE__) << " result =" << procDepenseDialog.readAllStandardError() ;
	qDebug() << __FILE__ << QString::number(__LINE__) << " result =" << procComptatriee.readAllStandardError() ;
	return a.exec();
}
