[eigen] Submitting patch to add pkg-config support

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


(Second attempt-- sorry if a duplicate)

Attached is an 'hg export' patch that adds pkg-config support against
trunk.  On a non-WIN32 system this installs lib/pkgconfig/eigen2.pc
alongside the include/eigen2/... headers.  The motivation for the
patch is that installing the pkgconfig file allows autoconf users to
easily see if Eigen is installed using the PKG_CHECK_MODULES macro.

Please double check me on the CMake details-- I've not used it before.

- Rhys
# HG changeset patch
# User Rhys Ulerich <rhys.ulerich@xxxxxxxxx>
# Date 1242751730 18000
# Node ID 1da87834f59de4bdd77883bffc557128c6e9b070
# Parent  66aaae8b8071fda4a548106b3a187c34e2d78c91
Added pkgconfig support

diff -r 66aaae8b8071 -r 1da87834f59d CMakeLists.txt
--- a/CMakeLists.txt	Tue May 19 10:21:24 2009 +0200
+++ b/CMakeLists.txt	Tue May 19 11:48:50 2009 -0500
@@ -27,6 +27,9 @@
   option(EIGEN_BUILD_LIB "Build the binary shared library" OFF)
 endif(NOT WIN32)
 option(EIGEN_BUILD_BTL "Build benchmark suite" OFF)
+if(NOT WIN32)
+  option(EIGEN_BUILD_PKGCONFIG "Build pkg-config .pc file for Eigen" ON)
+endif(NOT WIN32)
 
 if(EIGEN_BUILD_LIB)
   option(EIGEN_TEST_LIB "Build the unit tests using the library (disable -pedantic)" OFF)
@@ -98,6 +101,13 @@
     "The directory where we install the header files"
     FORCE)
 
+if(EIGEN_BUILD_PKGCONFIG)
+    configure_file(eigen2.pc.in eigen2.pc)
+    install(FILES eigen2.pc
+        DESTINATION lib/pkgconfig
+        )
+endif(EIGEN_BUILD_PKGCONFIG)
+
 add_subdirectory(Eigen)
 
 add_subdirectory(doc)
@@ -119,4 +129,4 @@
 
 if(EIGEN_BUILD_TESTS)
   ei_testing_print_summary()
-endif(EIGEN_BUILD_TESTS)
\ No newline at end of file
+endif(EIGEN_BUILD_TESTS)
diff -r 66aaae8b8071 -r 1da87834f59d eigen2.pc.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eigen2.pc.in	Tue May 19 11:48:50 2009 -0500
@@ -0,0 +1,7 @@
+
+Name: Eigen2
+Description: A C++ template library for linear algebra: vectors, matrices, and related algorithms
+Requires:
+Version: ${EIGEN_VERSION_NUMBER}
+Libs:
+Cflags: -I${INCLUDE_INSTALL_DIR}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/