[Rivet-svn] r1674 - trunk

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Sun Jul 12 23:02:24 BST 2009


Author: buckley
Date: Sun Jul 12 23:02:24 2009
New Revision: 1674

Log:
Detecting HepMC version at configure time

Modified:
   trunk/configure.ac

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	Fri Jul 10 08:57:46 2009	(r1673)
+++ trunk/configure.ac	Sun Jul 12 23:02:24 2009	(r1674)
@@ -79,6 +79,20 @@
 
 ## HepMC library
 AC_CEDAR_LIBRARYANDHEADERS([HepMC], , , [AC_MSG_ERROR([HepMC is required])])
+oldCPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS -I$HEPMCINCPATH"
+AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <iostream>
+#include "HepMC/HepMCDefs.h"],[std::cout << HEPMC_VERSION << std::endl; return 0;])])
+$CXX $CPPFLAGS conftest.cpp -o conftest 2>&1 1>&5
+hepmc_version=`./conftest`
+if test x$hepmc_version != x; then
+  let hepmc_major=`echo "$hepmc_version" | cut -d. -f1`
+  let hepmc_minor=`echo "$hepmc_version" | cut -d. -f2`
+fi
+HEPMC_VERSION=$hepmc_major$hepmc_minor
+AC_MSG_NOTICE([HepMC version is $hepmc_version -> $HEPMC_VERSION])
+AC_SUBST(HEPMC_VERSION)
+CPPFLAGS=$oldCPPFLAGS
 
 
 ## FastJet library


More information about the Rivet-svn mailing list