From 51eea1119ffacbd4d6e9291dd8bc445a394ebeb5 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Thu, 1 Nov 2018 12:59:16 +0000 Subject: [PATCH] Added information about pkg-config to README.md And a general revision. --- README.md | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 67d0a1d0..3ae5fdd0 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,9 @@ 3. [Build Options](#2-3) 4. [Dependencies](#2-4) 5. [Consuming Exiv2 with CMake](#2-5) - 6. [Building Exiv2 Documentation](#2-6) - 7. [Building Exiv2 Packages](#2-7) + 6. [Using pkg-config to compile and link your code with Exiv2](#2-6) + 7. [Building Exiv2 Documentation](#2-7) + 8. [Building Exiv2 Packages](#2-8) 3. [License and Support](#3) 1. [License](#3-1) 2. [Support](#3-2) @@ -43,7 +44,7 @@ write, delete and modify Exif, IPTC, XMP and ICC image metadata. | License (GPLv2) | [license.txt](license.txt) | | CMake Downloads | [https://cmake.org/download/](https://cmake.org/download/) | -The file ReadMe.txt in a Build bundle describes how to install/link code with libraries for their respective platform. +The file ReadMe.txt in a Build bundle describes how to install the library on the platform. ReadMe.txt also documents how to compile and link code on the platform. [TOC](#TOC) @@ -60,7 +61,7 @@ $ cmake .. -G "Unix Makefiles" ; cmake --build . ; make test $ sudo make install ``` -This will install the library into the "standard locations". The library will be install in `/usr/local/lib`, executables (including the exiv2 command-line program) in `/usr/local/bin/` and header files in `/usr/local/include/exiv2` +This will install the library into the "standard locations". The library will be installed in `/usr/local/lib`, executables (including the exiv2 command-line program) in `/usr/local/bin/` and header files in `/usr/local/include/exiv2` #### Uninstall Exiv2 on a UNIX-like system @@ -124,15 +125,27 @@ See [README-CONAN](README-CONAN.md) for more information. ### 2.5 Consuming Exiv2 with CMake -When installing exiv2 by running the **install** target we get some files under the folder -${CMAKE\_INSTALL\_PREFIX/share/exiv2/cmake/. +When exiv2 is installed, the files required to consume Exiv2 are installed in `${CMAKE_INSTALL_PREFIX}/share/exiv2/cmake/` -In the example project https://github.com/piponazo/exiv2Consumer you can see how to consume -exiv2 via CMake using these files. +Demonstration Project to consume Exiv2 via CMake using those files: [https://github.com/piponazo/exiv2Consumer](https://github.com/piponazo/exiv2Consumer) [TOC](#TOC) -### 2.6 Building Exiv2 Documentation +### 2.6 Using pkg-config to compile and link your code with Exiv2 + +When exiv2 is installed, the file for pkg-config is installed in `${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/` + +Conventionally, add the following to your Makefile. + +``` +PKGCONFIG=pkg-config +CPPFLAGS := `pkg-config exiv2 --cflags` +LDFLAGS := `pkg-config exiv2 --libs` +``` + +[TOC](#TOC) + +### 2.7 Building Exiv2 Documentation ``` $ cmake ..options.. -DEXIV2_BUILD_DOC=On @@ -146,8 +159,12 @@ To build the documentation, you will need the following products: | doxygen
graphviz
python
xsltproc
md5sum | [http://www.doxygen.org/](http://www.doxygen.org/)
[http://www.graphviz.org/](http://www.graphviz.org/)
[http://www.python.org/](http://www.python.org/)
[http://xmlsoft.org/XSLT/](http://xmlsoft.org/XSLT/)
[http://www.microbrew.org/tools/md5sha1sum/](http://www.microbrew.org/tools/md5sha1sum/) | [TOC](#TOC) - -### 2.7 Building Exiv2 Packages + +### 2.8 Building Exiv2 Packages + +You should not build Exiv2 Packages. This feature is intended for use by Team Exiv2 to create Platform Bundles and Source Packages on the buildserver. + +To enable building of packages, use the CMake option `-DEXIV2_TEAM_PACKAGING=On`. There are two types of Exiv2 packages which are generated by cpack from the cmake command-line. @@ -159,7 +176,7 @@ Create and build exiv2 for your plantform. $ git clone https://github.com/exiv2/exiv2 $ mkdir -p exiv2/build $ cd exiv2/build -$ cmake .. -G "Unix Makefiles" +$ cmake .. -G "Unix Makefiles" -DEXIV2_TEAM_PACKAGING=On ... -- Build files have been written to: .../build $ cmake --build . --config Release @@ -176,7 +193,7 @@ CPack: - package: /path/to/exiv2/build/exiv2-0.27.0.1-Linux.tar.gz generated. $ make package_source Run CPack packaging tool for source... ... -CPack: - package: /path/to/exiv2/build/exiv2-0.27.0.1-Source.tar.bz2 generated. +CPack: - package: /path/to/exiv2/build/exiv2-0.27.0.1-Source.tar.gz generated. ``` You may prefer to run `$ cmake --build . --config Release --target package_source` @@ -227,13 +244,14 @@ Update your system and install the build tools. ``` sudo apt --yes update -sudo apt install --yes build-essential git libxml2-utils cmake python3 libexpat1-dev +sudo apt install --yes build-essential git libxml2-utils cmake python3 libexpat1-dev libz-dev ``` Get the code from GitHub and build ``` $ mkdir -p ~/gnu/github/exiv2 +$ cd ~/gnu/github/exiv2 $ git clone https://github.com/exiv2/exiv2 $ cd exiv2 $ mkdir build ; cd build ; @@ -255,7 +273,8 @@ I recommend that you build and install CMake from source. ### 4.3 MinGW -We provide support for both 64bit and 32bit builds using MinGW/msys2. [https://www.msys2.org](https://www.msys2.org)
+We provide support for both 64bit and 32bit builds using MinGW/msys2. [https://www.msys2.org](https://www.msys2.org) + Support for MinGW/msys1.0 32 bit build was provided for Exiv2 v0.26. MinGW/msys1.0 is not supported by Team Exiv2 for Exiv2 v0.27 and later. #### MinGW/msys2 64 bit @@ -298,6 +317,7 @@ for i in base-devel git cmake coreutils python3 man gcc gdb make dos2unix diffut ``` $ mkdir -p ~/gnu/github/exiv2 +$ cd ~/gnu/github/exiv2 $ git clone https://github.com/exiv2/exiv2 $ cd exiv2 $ mkdir build ; cd build ; @@ -307,7 +327,7 @@ $ make #### MinGW and Regex -The exiv2 command line program provides a `--grep` option which filters output. The implementation requires the header file `` and supporting library to be available during the build. When not available, the option degrades to a substring match. Because there are multiple versions of `` available on the MinGW platform, detection of Regex is always disabled on this platform. +The exiv2 command line program provides a `--grep` option which filters output. The implementation requires the header file `` and supporting library to be available during the build. When not available, the option degrades to a substring match. Because there are several versions of `` available on the MinGW platform, detection of Regex is always disabled on this platform and uses substring match. [TOC](#TOC)