Documentation updates + release notes

- Consuming with CMake
- Debugging Exiv2
- Added "2.13 Building Exiv2 with ccache".
- Revised "Building Exiv2 with ccache" in response to Dan's feedback.
- Fixed typo in README.md
- ReleaseNotes update in preparation for RC3.
v0.27.3
Robin Mills 7 years ago committed by Luis Díaz Más
parent 5e75f51fde
commit dc33d75ad2

2
.gitignore vendored

@ -7,6 +7,8 @@
*.pyc
*.txt.user
.DS_Store
.idea/*
cmake-*
build*
po/POTFILES
po/remove-potcdate.sed

@ -110,7 +110,7 @@ The output from this command is quite long as conan downloads or builds zlib, ex
##### 1.5) Execute cmake to generate build files for your environment.
```bash
$ cmake .. # -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release
$ cmake .. # -G "Visual Studio 15 2017 Win64"
```
<name id="1-6"></a>
@ -131,7 +131,7 @@ $ cmake --build . --config Release
When you run conan install for the first time, it will detect and write the default profile ~/.conan/profile/default. On my Ubuntu system with GCC 4.9, this is:
```bash
```ini
[settings]
os=Linux
os_build=Linux
@ -162,7 +162,6 @@ settings works with conan and different compilers:
compiler.libcxx=libstdc++11 # will use -stdlib=libstdc++ and define _GLIBCXX_USE_CXX11_ABI=1
compiler.libcxx=libstdc++ # will use -stdlib=libstdc++ and define _GLIBCXX_USE_CXX11_ABI=0
compiler.libcxx=libc++ # will use -stdlib=libc++
```
As a rule of thumb, set `compiler.libcxx=libstdc++11` when using a version of gcc >= 5.1.
@ -180,7 +179,7 @@ algorithms when bringing the Exiv2 dependencies with conan, this might indicate
I use the following batch file to start cmd.exe. I do this to reduce the complexity of the path which grows as various tools are installed on Windows. The purpose of this script is to ensure a "stripped down path".
```
```bat
@echo off
setlocal
cd %HOMEPATH%
@ -190,9 +189,18 @@ cmd
### Profiles for Visual Studio
You can build Exiv2 with either Visual Studio 2015 (version 14) or 2017 (version 15). You create profiles in %HOMEPATH%\.conan\profiles with a text editor.
You can build Exiv2 with Visual Studio 2017 (version 15), 2015 (version 14), 2013 (version 12), 2012 (version 11), 2010 (version 10) or 2008 (version 9).
You create profiles in %HOMEPATH%\.conan\profiles with a text editor. For your convenience, you'll find profiles in **<exiv2dir>/cmake/msvc\_conan\_profiles**. There are 24 in total:
```
Profile := msvc{Edition}{Type}{Bits}
Edition := { 2017 | 2015 | 2013 | 2012 | 2010 | 2008 }
Type := { Release | Debug }
Bits := { 64 | 32 }
Examples: msvc2017Release64 msvc2015Debug32
```
If you have an installation of Visual Studio 2017, the profile msvc2017Release64 is as follows:
The profile msvc2017Release64 is as follows:
```ini
[build_requires]
@ -214,73 +222,63 @@ os_build=Windows
In the step-by-step guide, the command `$ cmake ..` uses
the default CMake generator. Always use the generator for your version of Visual Studio. For example:
```bash
```bat
c:\....\exiv2\build> conan install .. --profile msvc2017Release64 --build missing
c:\....\exiv2\build> cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_NLS=0
c:\....\exiv2\build> cmake .. -G "Visual Studio 15 2017 Win64"
c:\....\exiv2\build> cmake --build . --config Release
```
CMake provides 4 Generators. The 64 and 32 bit Generators have different names:
CMake provides Generators for different editions of Visual Studio. The 64 and 32 bit Generators have different names:
| Architecture | Visual Studio 2015 | Visual Studio 2017|
|:---------|--------------------|--------------------|
| 64 bit | "Visual Studio 14 2015 Win64" | "Visual Studio 15 2017 Win64" |
| 32 bit | "Visual Studio 14 2015" | "Visual Studio 15 2017" |
| Architecture | Visual Studio 2017 | Visual Studio 2015 | Visual Studio 2013 |
|:--------- |--------------------|--------------------|--------------------|
| 64 bit | "Visual Studio 15 2017 Win64" | "Visual Studio 14 2015 Win64" | "Visual Studio 12 2013 Win64" |
| 32 bit | "Visual Studio 15 2017" | "Visual Studio 14 2015" | "Visual Studio 12 2013 " |
### Recommended settings for Visual Studio
##### 64 bit Release Build
| | Visual Studio 2015 | Visual Studio 2017|
| | Visual Studio 2017 | Visual Studio 2015|
|:---------|--------------------|--------------------|
| _**conan install .. --profile**_ | msvc2015Release64 | msvc2017Release64 |
| _**cmake -G**_ | "Visual Studio 14 2015 Win64" | "Visual Studio 15 2017 Win64" |
| _**cmake**_ | -DCMAKE\_BUILD\_TYPE=Release | -DCMAKE\_BUILD\_TYPE=Release |
| _**profile**_ | arch=x86\_64 | arch=x86\_64 |
| | arch\_build=x86\_64 | arch\_build=x86\_64 |
| | build\_type=Release | build\_type=Release |
| | compiler.runtime=MD | compiler.runtime=MD |
| | compiler.version=14 | compiler.version=15 |
| | compiler=Visual Studio | compiler=Visual Studio |
| | os=Windows | os=Windows |
| | os\_build=Windows | os\_build=Windows |
| _**conan install .. --profile**_ | msvc2017Release64 | msvc2015Release64 |
| _**cmake -G**_ | "Visual Studio 15 2017 Win64" | "Visual Studio 14 2015 Win64" |
| _**profile**_<br><br><br><br><br><br><br>_ | arch=x86\_64<br>arch\_build=x86\_64<br>build\_type=Release<br>compiler.runtime=MD<br>compiler.version=15<br>compiler=Visual Studio<br>os=Windows<br>os\_build=Windows | arch=x86\_64<br>arch\_build=x86\_64<br>build\_type=Release<br>compiler.runtime=MD<br>compiler.version=14 <br>compiler=Visual Studio<br>os=Windows<br>os\_build=Windows |
##### Debug Builds
|| Visual Studio 2015 | Visual Studio 2017|
|| Visual Studio 2017 | Visual Studio 2015 |
|:-------|-------|------|
| _**conan install .. --profile**_ | msvc2015Debug64 | msvc2017Debug64 |
| _**cmake**_ | -DCMAKE\_BUILD\_TYPE=Debug | -DCMAKE\_BUILD\_TYPE=Debug |
| _**profile**_ | build_type=Debug | build_type=Debug |
| | compiler.runtime=MDd | compiler.runtime=MDd |
| _**conan install .. --profile**_ | msvc2017Debug64 | msvc2015Debug64 |
| _**profile**_<br>_ | build\_type=Debug<br>compiler.runtime=MDd | build_type=Debug<br>compiler.runtime=MDd |
##### 32bit Builds
|| Visual Studio 2015 | Visual Studio 2017|
|| Visual Studio 2017 | Visual Studio 2015 |
|:-----------|--------------------|--------------------|
| _**conan install .. --profile**_ | msvc2015Release32 | msvc2017Release32 |
| _**cmake -G**_ | "Visual Studio 14 2015" | "Visual Studio 15 2017" |
| _**profile**_ | arch=x86 | arch=x86 |
| | arch_build=x86 | arch_build=x86 |
| _**conan install .. --profile**_ | msvc2017Release32 | msvc2015Release32 |
| _**cmake -G**_ | "Visual Studio 15 2017" | "Visual Studio 14 2015" |
| _**profile**_<br>_ | arch=x86<br>arch\_build=x86 | arch=x86<br>arch\_build=x86 |
##### Static Builds
The default (and recommended) builds of Exiv2 and sample applications build and use DLLs. If you wish to build static applications and libraries, you will need to set the correct "C" run-time library to be linked both to your code and dependencies being built/downloaded by conan.
The default builds of Exiv2 and sample applications build use DLLs.
| Static Release | Static Debug |
|:---------|:-------------------|
| compiler.runtime=MT | compiler.runtime=MTd |
Additionally, you will have to use the cmake option -DBUILD\_SHARED\_LIBS=Off
To build static libraries, use the cmake option -DBUILD\_SHARED\_LIBS=Off.
```bash
$ cmake -DBUILD_SHARED_LIBS=Off ..
```
$ cmake -DBUILD_SHARED_LIBS=Off -DEXIV2_ENABLE_NLS=0 ..
```
If you wish to use the static C run-time library, use the following option in the conan profile.
| | Static Release | Static Debug |
|:--- |:--------- |:-------------------|
| **profile setting** | compiler.runtime=MT | compiler.runtime=MTd |
### Changing profile settings with the conan command
It is recommended that you create 8 profiles for msvc{2017|2015}{Release|Debug}{64|32}.
It is recommended that you use profiles provided in **<exiv2dir>/cmake/msvc\_conan\_profiles**.
You can modify profile settings on the command line.
The following example demonstrates making substantial changes to profile settings by performing a 32 bit build using Visual Studio 2015 with a 2017 profile! This example is not considered good practice, it is an illustration to some conan flexibility which be useful when your build environment is automated.
@ -291,32 +289,19 @@ $ cmake .. -G "Visual Studio 2015"
$ cmake --build . --config Release
```
### CMake/Cygwin Collisions on the build machine
If you have Cygwin installed on your build machine, you may encounter the situation
that CMake erroneously finds library files in Cygwin directories and adds `c:\\cygwin64\\usr\\include` to the
compiler header search path. FindIntl is a prime suspect and I believe this issue is caused by %PATH%.
I recommend that you disable Natural Language Support when building with Visual Studio:
```
$ cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_NLS=Off
```
If necessary, temporarily rename c:\\cygwin64\\usr\\include as c:\\cygwin64\\usr\\uncle to hide those files when working with CMake.
[TOC](#TOC)
<name id="2-3"></a>
### 2.3) Cygwin Notes
Do not use conan on the Cygwin Platform. To build Exiv2 for Cygwin use CMake without conan. We recommend installing or building dependences (expat, zlib) with platform tools.
Do not use conan on the Cygwin Platform. To build Exiv2 for Cygwin use CMake without conan. We recommend installing dependences (expat, zlib) with platform tools or build/install from source.
[TOC](#TOC)
<name id="2-4"></a>
### 2.4) MinGW Notes
Team Exiv2 supports MinGW msys/2. Team Exiv2 does not support MinGW msys/1.0.
As with Cygwin, we recommend installing or building dependencies with platform tools dependencies and using CMake to build Exiv2.
As with Cygwin, we do not recommend using conan to build on the MinGW/msys2 platform. We recommend installing dependences (expat, zlib) with platform tools or build/install from source.
[TOC](#TOC)
<name id="3">
@ -592,9 +577,11 @@ Exiv2 can perform I/O using internet protocols such as https, https, ftp and ssh
The feature is disabled by default. You will need to instruct conan to build/download necessary libraries (curl, openssl and libssh) and tell CMake to link to the libraries.
```
```bash
$ conan install .. --options webready=True
$ cmake -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_ENABLE_SSH=ON ..
```
[TOC](#TOC)
Written by Robin Mills<br>robin@clanmills.com<br>Updated: 2018-11-22

@ -17,6 +17,9 @@
8. [Localisation](#2-8)
9. [Building Exiv2 Documentation](#2-9)
10. [Building Exiv2 Packages](#2-10)
11. [Debugging Exiv2](#2-11)
12. [Building Exiv2 with Clang and other build chains](#2-12)
13. [Building Exiv2 with ccache](#2-13)
3. [License and Support](#3)
1. [License](#3-1)
2. [Support](#3-2)
@ -24,7 +27,6 @@
1. [Running tests on a UNIX-like system](#4-1)
2. [Running tests on Visual Studio builds](#4-2)
3. [Unit tests](#4-3)
<name id="platforms">
5. [Platform Notes](#5)
1. [Linux](#5-1)
2. [MacOS-X](#5-2)
@ -59,7 +61,7 @@ You need CMake to build Exiv2: https://cmake.org/download/
<name id="2-1">
### 2.1 Build, Install, Use, Uninstall Exiv2 on a UNIX-like system
```
```bash
$ cd <exiv2dir> ; mkdir build ; cd build
$ cmake .. -G "Unix Makefiles" ; cmake --build . ; make test
$ sudo make install
@ -71,20 +73,20 @@ This will install the library into the "standard locations". The library will b
To execute the exiv2 command line program, you should update your path to search /usr/local/bin/
```
```bash
$ export PATH="/usr/local/bin:$PATH"
```
you'll also need to locate libexiv2 at run time:
```
```bash
$ export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" # Linux, Cygwin, MinGW/msys2
$ export DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH" # MacOS-X
```
#### Uninstall Exiv2 on a UNIX-like system
```
```bash
$ sudo make uninstall
```
@ -103,11 +105,11 @@ There are two groups of CMake options. There are many options defined by CMake.
| Options | Purpose (_default_) |
|:------------- |:------------- |
| CMAKE\_INSTALL\_PREFIX<br/>CMAKE\_BUILD\_TYPE<br/>BUILD\_SHARED\_LIBS | Where to install on your computer _**(/usr/local)**_<br/>Type of build _**(Release)**_<br/>Build exiv2lib as shared or static _**(On)**_ |
| CMAKE\_INSTALL\_PREFIX<br/>CMAKE\_BUILD\_TYPE<br/>BUILD\_SHARED\_LIBS | Where to install on your computer _**(/usr/local)**_<br/>Type of build _**(Release)**_ See: [Debugging Exiv2](#2-11) <br/>Build exiv2lib as shared or static _**(On)**_ |
Options defined by <exiv2>/CMakeLists.txt include:
```
```bash
576 rmills@rmillsmm:~/gnu/github/exiv2/exiv2 $ grep ^option CMakeLists.txt
option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library" ON )
option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON )
@ -118,7 +120,7 @@ option( EXIV2_ENABLE_PNG "Build with png support (requires libz)"
```
Options are defined on the CMake command line:
```
```bash
$ cmake -DBUILD_SHARED_LIBS=On -DEXIV2_ENABLE_NLS=OFF
```
@ -136,7 +138,7 @@ The following Exiv2 features are enabled by default and require external librari
On Linux, you may install the dependencies using the distribution's package management system. Install the development package of a dependency to install the header files and static libraries required to build Exiv2.
Notes about different platforms are included in this document: [Platform Notes](#platforms)
Notes about different platforms are included in this document: [Platform Notes](#5)
You may choose to install dependences with conan. This is supported on all platforms and is especially useful for users of Visual Studio.
See [README-CONAN](README-CONAN.md) for more information.
@ -145,25 +147,25 @@ See [README-CONAN](README-CONAN.md) for more information.
<name id="2-5">
### 2.5 Building and linking your code with Exiv2
There are detailed platform notes about linking code in releasenotes\platform\ReadMe.txt
There are detailed platform notes about linking code in releasenotes/platform/ReadMe.txt
Platform: Linux | Darwin | MinGW | CYGWIN | MSVC
platform: { CYGWIN| Darwin | Linux | MinGW | msvc }
In general you need to do the following:
1) Application code should be written in C++ 98 and should include exiv2 headers:
1) Application code should be written in C++ 98 and include exiv2 headers:
```
```C++
#include <exiv2/exiv2.hpp>
```
2 You should compile your C++ code with the directive: `-I/usr/local/include`
2 Compile your C++ code with the directive: **`-I/usr/local/include`**
3 You should link your code with libexiv2 using the linker options: `-lexiv2` and `-L/usr/local/lib`
3 Link your code with libexiv2 using the linker options: **`-lexiv2`** and **`-L/usr/local/lib`**
The following is a typical command to build an link with libexiv2:
The following is a typical command to build and link with libexiv2:
```
```bash
$ g++ -std=c++98 myprog.cpp -o myprog -I/usr/local/include -L/usr/local/lib -lexiv2
```
@ -173,7 +175,33 @@ $ g++ -std=c++98 myprog.cpp -o myprog -I/usr/local/include -L/usr/local/lib -lex
When exiv2 is installed, the files required to consume Exiv2 are installed in `${CMAKE_INSTALL_PREFIX}/share/exiv2/cmake/`
A Project to demonstrate consuming Exiv2 via CMake using those files is available here: [https://github.com/piponazo/exiv2Consumer](https://github.com/piponazo/exiv2Consumer)
You can build samples/exifprint.cpp as follows:
```bash
$ cd <exiv2dir>
$ mkdir exifprint
$ cd exifprint
$ *** EDIT CMakeLists.txt ***
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project(exifprint VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(exiv2 REQUIRED CONFIG NAMES exiv2) # search ${CMAKE_INSTALL_PREFIX}/share/exiv2/cmake/
add_executable(exifprint ../samples/exifprint.cpp) # compile this
target_link_libraries(exifprint exiv2) # link exiv2
$ cmake . # generate the makefile
$ make # build the code
$ ./exifprint # test your executable
Usage: ./exifprint [ file | --version || --version-test ]
$
```
The default cmake Generator is usually appropriate for your platform. Additional information concerning Generators for Visual Studio in [README-CONAN](README-CONAN.md)
[TOC](#TOC)
<name id="2-7">
@ -181,13 +209,13 @@ A Project to demonstrate consuming Exiv2 via CMake using those files is availabl
When exiv2 is installed, the file exiv2.pc used by pkg-config is installed in `${CMAKE_INSTALL_PREFIX}/lib/pkgconfig` You will need to set the following in your environment:
```
```bash
$ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
```
To compile and link using exiv2.pc, you usually add the following to your Makefile.
```
```bash
PKGCONFIG=pkg-config
CPPFLAGS := `pkg-config exiv2 --cflags`
LDFLAGS := `pkg-config exiv2 --libs`
@ -195,7 +223,7 @@ LDFLAGS := `pkg-config exiv2 --libs`
If you are not using make, you can use pkg-config as follows:
```
```bash
g++ -std=c++98 myprogram.cpp -o myprogram $(pkg-config exiv2 --libs --cflags)
```
@ -203,13 +231,13 @@ g++ -std=c++98 myprogram.cpp -o myprogram $(pkg-config exiv2 --libs --cflags)
<name id="2-8">
### 2.8 Localisation
Localisation is supported on "*ix" platforms: Linux, MacOS-X, Cygwin and MinGW/msys2. Localisation is not supported for Visual Studio builds.
Localisation is supported on a UNIX-like platform: Linux, MacOS-X, Cygwin and MinGW/msys2. Localisation is not supported for Visual Studio builds.
To build localisation support, use the CMake options `-DEXIV2_BUILD_PO=On` There are no additional build steps as the normal build command will compile the library, samples and localisation support.
To build localisation support, use the CMake option **`-DEXIV2_BUILD_PO=On`**. There are no additional build steps as the normal build commands will compile the library, samples and localisation support. You must install the build to ensure the localisation message files can be found at run-time.
1) Running exiv2 in a foreign language
```
```bash
$ env LANG=fr_FR exiv2 # env LANGUAGE=fr_FR exiv2 on Linux!
exiv2: Une action doit être spécifié
exiv2: Au moins un fichier est nécessaire
@ -225,7 +253,7 @@ To support a new language which we'll designate 'xy' for this discussion:
2.1) Generate a po file from the po template:
```
```bash
$ cd <exiv2dir>
$ mkdir -p po/xy
$ msginit --input=po/exiv2.pot --locale=xy --output=po/xy.po
@ -234,14 +262,14 @@ $ msginit --input=po/exiv2.pot --locale=xy --output=po/xy.po
I edited the following:
```
```bash
#: src/exiv2.cpp:237
msgid "Manipulate the Exif metadata of images.\n"
msgstr ""
```
to:
```
```bash
#: src/exiv2.cpp:237
msgid "Manipulate the Exif metadata of images.\n"
msgstr "Manipulate image metadata.\n"
@ -249,7 +277,7 @@ msgstr "Manipulate image metadata.\n"
2.3) Generate the messages file:
```
```bash
$ mkdir -p po/xy/LC_MESSAGES
$ msgfmt --output-file=po/xy/LC_MESSAGES/exiv2.mo po/xy.po
```
@ -258,9 +286,9 @@ $ msgfmt --output-file=po/xy/LC_MESSAGES/exiv2.mo po/xy.po
You have to install your messages to test them. It's not possible to test a message file from the build/bin directory.
```
```bash
$ sudo cp -R po/xy /usr/local/share/locale/xy
$ env LANG=xy exiv2 # env LANGUAGE=fr_FR xy on Linux!
$ env LANG=xy exiv2 # env LANGUAGE=xy on Linux!
exiv2: An action must be specified
exiv2: At least one file is required
Usage: exiv2 [ options ] [ action ] file ...
@ -284,10 +312,10 @@ read the documentation on-line from the project website: http://exiv2.dyndns.org
Additionally, complete copies of the project website are archived on the buildserver
and can be downloaded for off-line use. http://exiv2.dyndns.org:8080/userContent/builds/Website/
To build documentation, use the CMake option `-DEXIV2_BUILD_DOC=On`.
To build documentation, use the CMake option **`-DEXIV2_BUILD_DOC=On`**.
Additionally, you will require an additional build step to actually build the documentation.
```
```bash
$ cmake ..options.. -DEXIV2_BUILD_DOC=On
$ make doc
```
@ -302,7 +330,7 @@ To build the documentation, you must install the following products:
<name id="2-10">
### 2.10 Building Exiv2 Packages
To enable building of packages, use the CMake option `-DEXIV2_TEAM_PACKAGING=On`.
To enable building of packages, use the CMake option **`-DEXIV2\_TEAM\_PACKAGING=On`**.
You should not build Exiv2 Packages. This feature is intended for use by Team Exiv2 to create Platform and Source Packages on the buildserver.
@ -338,6 +366,160 @@ 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`
[TOC](#TOC)
<name id="2-11">
### 2.11 Debugging Exiv2
1) Generating and installing a debug library
In general to generate a debug library, you should use the option *cmake* option **`-DCMAKE_RELEASE_TYPE=Debug`** and build in the usual way.
```bash
$ cd <exiv2dir>
$ mkdir build
$ cd build
$ cmake .. -G "Unix Makefiles" "-DCMAKE_BUILD_TYPE=Debug"
$ make
$ sudo make install
```
You must install the library to ensure that your code is linked to the debug library.
You can check that you have generated a debug build with the command:
```bash
$ exiv2 -vVg debug
exiv2 0.27.0.3
debug=1
$
```
[TOC](#TOC)
2) About preprocessor symbols **NDEBUG** and **DEBUG**
In accordance with current practice, exiv2 respects the symbol *NDEBUG* which is set for Release builds. There are sequences of code which are defined within:
```C++
#ifdef DEBUG
....
#endif
```
Those blocks of code are not compiled for debug builds. They are provided for additional debugging information. For example, if you are interested in additonal output from webpimage.cpp, you can update your build as follows:
```bash
$ cd <exiv2dir>
$ touch src/webpimage.cpp
$ make CXXFLAGS=-DDEBUG
$ bin/exiv2 ...
-- or --
$ sudo make install
$ exiv2 ...
```
If you are debugging library code, it is recommended that you use the exiv2 command-line as your test harness as Team Exiv2 is very familiar with this tool and able to give support.
[TOC](#TOC)
3) Starting the debugger
This is platform specific. On Linux:
```bash
$ gdb exiv2
```
[TOC](#TOC)
4) Using Debugger IDEs such as Xcode, CLion, Visual Studio, Eclipse or QtCreator
I have used all those IDEs to debug the Exiv2 library and applications. All of them work. You may find it takes initial effort, however I assure you that they all work well.
I personally use CLion which has excellent integration with CMake. It will automatically add **`-DCMAKE_BUILD_TYPE=Debug`** to the cmake command. It keeps build types in separate directories such as **`<exiv2dir>/cmake-build-debug`**.
[TOC](#TOC)
5) cmake --build . options **`--config Release|Debug`** and **`--target install`**
Visual Studio and Xcode can build debug or release builds without using the option **`-DCMAKE_BUILD_TYPE`** because the generated project files can build multiple types. The option **`--config Debug`** can be specified on the command-line to specify the build type. Alternatively, if you prefer to build in the IDE, the UI provides options to select the configuration and target.
With the Unix Makefile generator, the targets can be listed:
```bash
$ make help
The following are some of the valid targets for this Makefile:
... all (the default if no target is provided)
... clean
... depend
... install/local
.........
```
[TOC](#TOC)
<name id="2-12">
### 2.12 Building Exiv2 with **clang** and other build chains
1) On Linux
```bash
$ cd <exiv2dir>
$ rm -rf build ; mkdir build ; cd build
$ cmake .. -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++)
$ cmake --build .
```
**_OR_**
```bash
$ export CC=$(which clang)
$ export CXX=$(which clang++)
$ cd <exiv2dir>
$ rm -rf build ; mkdir build ; cd build
$ cmake ..
$ cmake --build .
```
2) On MacOS-X
Apple provide clang with Xcode. GCC has not been supported by Apple since 2013. The _"normal unix build"_ uses Clang.
3) On Cygwin, MinGW/msys2, Windows (using clang-cl) and Visual Studio.
I have been unable to get clang to work on any of those platforms.
4) Cross Compiling
I've never succeeded in getting this to work. I use different VMs for Linux 32 and 64 bit. I've documented how to set up Cygwin and MinGW/msys2 for 64 and 32 bit builds in [README-CONAN](README-CONAN.md)
[TOC](#TOC)
<name id="2-13">
### 2.13 Building Exiv2 with ccache
To speed up compilation, the utility ccache can be installed to cache the output of the compiler. This greatly speeds up the build when you frequently built code that has not been modified.
Installing and using ccache (and other similar utilities), is platform dependent. On Ubuntu:
```bash
$ sudo apt install --yes ccache
```
To build with ccache, use the cmake option **-DBUILD\_WITH\_CCACHE=On**
```bash
$ cd <exiv2dir>
$ mkdir build ; cd build ; cd build
$ cmake .. -G "Unix Makefiles" -DBUILD_WITH_CCACHE=On
$ make
# Build again to appreciate the performance gain
$ make clean
$ make
```
Due to the way in which ccache is installed in Fedora (and other Linux distros), ccache effectively replaces the compiler. A default build or **-DBUILD\_WITH\_CCACHE=Off** is not effective and the environment variable CCACHE_DISABLE is required to disable ccache. [https://github.com/Exiv2/exiv2/issues/361](https://github.com/Exiv2/exiv2/issues/361)
[TOC](#TOC)
<name id="3">
## 3 License and Support
@ -382,8 +564,9 @@ The test suite is a mix of bash and python scripts. The python scripts are new
You can run the suite directly from the build:
```
$ make build
```bash
$ cmake .. -G "Unix Makefiles"
$ make
...
$ make tests
... lots of output ...
@ -392,7 +575,7 @@ Summary report
You can run individual tests in the test directory using the environment variable EXIV2\_BINDIR to specify the location of the build artifacts. For Cygwin and MinGW/msys builds, also set EXIV2_EXT=.exe
```
```bash
rmills@rmillsmbp-w7 ~/gnu/github/exiv2/exiv2/build $ cd ../test
rmills@rmillsmbp-w7 ~/gnu/github/exiv2/exiv2/test $ env EXIV2_BINDIR=${PWD}/../build/bin ./icc-test.sh
ICC jpg md5 webp md5 png md5 jpg md5
@ -407,7 +590,7 @@ rmills@rmillsmbp-w7 ~/gnu/github/exiv2/exiv2/test $ env EXIV2_BINDIR=${PWD}/../b
Use the bash interpreter for MinGW/msys2 to run the test suite. It's essential to have a DOS Python3 interpreter on your path. The variables EXIV2\_BINDIR and EXIV2\_EXT enable the test suite to locate the MSVC build artifacts.
```
```bash
$ cd <exiv2dir>/build
$ cd ../test
$ PATH="/c/Python36:$PATH"
@ -415,9 +598,9 @@ $ export EXIV2_EXT=.exe
$ export EXIV2_BINDIR=${PWD}/../build/bin
```
Once you have modified the PATH and and exported EXIV2\_BINDIR and EXIV2\_EXT, you can execute the test suite as described for Unix type systems:
Once you have modified the PATH and and exported EXIV2\_BINDIR and EXIV2\_EXT, you can execute the test suite as described for UNIX-like systems:
```
```bash
$ cd <exiv2dir>/test
$ make test
$ make newtests
@ -430,11 +613,11 @@ $ ./icc-test.sh
The code for the unit tests is in `<exiv2dir>/unitTests`
To build the unit tests, use the CMake option `-DEXIV2_BUILD_UNIT_TESTS=On`.
To build the unit tests, use the *cmake* option **`-DEXIV2_BUILD_UNIT_TESTS=On`**.
To execute the unit tests:
```
```bash
$ cd <exiv2dir>/build
$ bin/unit_tests
```
@ -450,14 +633,14 @@ There are many ways to set up and configure your platform. The following notes
Update your system and install the build tools.
```
```bash
sudo apt --yes update
sudo apt install --yes build-essential git libxml2-utils cmake python3 libexpat1-dev libz-dev
```
Get the code from GitHub and build
```
```bash
$ mkdir -p ~/gnu/github/exiv2
$ cd ~/gnu/github/exiv2
$ git clone https://github.com/exiv2/exiv2
@ -471,7 +654,7 @@ $ make
<name id="5-2">
### 5.2 MacOS-X
You will need to install Xcode and the Xcode command-line tools to build anything on the Mac.
You will need to install Xcode and the Xcode command-line tools to build on the Mac.
You should build and install libexpat and zlib. You may use brew, macports, build from source, or use conan.
@ -486,15 +669,16 @@ We provide support for both 64bit and 32bit builds using MinGW/msys2. [https://w
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
Install: [http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe](http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe)
Install: [http://repo.msys2.org/distrib/x86\_64/msys2-x86\_64-20180531.exe](http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe)
I use the following batch file to start the MinGW/msys2 64 bit bash shell from the Dos Command Prompt (cmd.exe)
```
```bat
@echo off
setlocal
set "PATH=c:\msys64\usr\bin;c:\msys64\usr\local\bin;"
set "HOME=c:\msys64\home\rmills"
if NOT EXIST %HOME% mkdir %HOME%
cd %HOME%
set "PS1=\! MSYS64:\u@\h:\w \$ "
bash.exe -norc
@ -505,11 +689,12 @@ Install: [http://repo.msys2.org/distrib/i686/msys2-i686-20180531.exe](http://rep
I use the following batch file to start the MinGW/msys2 32 bit bash shell from the Dos Command Prompt (cmd.exe)
```
```bat
@echo off
setlocal
set "PATH=c:\msys32\usr\bin;c:\msys32\usr\local\bin;"
set "HOME=c:\msys32\home\rmills"
if NOT EXIST %HOME% mkdir %HOME%
cd %HOME%
set "PS1=\! MSYS32:\u@\h:\w \$ "
bash.exe -norc
@ -519,19 +704,19 @@ bash.exe -norc
Install tools and dependencies:
```
```bash
$ for i in base-devel git cmake coreutils python3 man gcc gdb make dos2unix diffutils zlib-devel libexpat-devel libiconv-devel gettext-devel; do (echo y|pacman -S $i); done
```
You can upgrade all installed packages on your system with the following command. For me, this broke msys32 and I had to reinstall msys32 and all the dependencies. Your experience may be different.
```
```bash
$ pacman -Syu
```
#### Download exiv2 from github and build
```
```bash
$ mkdir -p ~/gnu/github/exiv2
$ cd ~/gnu/github/exiv2
$ git clone https://github.com/exiv2/exiv2
@ -543,28 +728,36 @@ $ make
#### MinGW and Regex
The exiv2 command line program provides a `--grep` option which filters output. The implementation requires the header file `<regex.h>` 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 `<regex.h>` available on the MinGW platform, detection of Regex is always disabled on this platform and uses substring match.
The exiv2 command line program provides an option **`--grep`** to filter output. The implementation requires the header file **`<regex.h>`** and supporting library to be available during the build. When not available, the option **`--grep`** degrades to a substring match. Because there are several versions of **`<regex.h>`** available on the MinGW platform, detection of regex is always disabled on this platform and uses substring match. The following command reveals if regex is included in your build:
```bash
$ exiv2 -vVg regex
exiv2 0.27.0.3
have_regex=1
$
```
[TOC](#TOC)
<name id="5-4">
### 5.4 Cygwin
Download: [https://cygwin.com/install.html](https://cygwin.com/install.html) and run setup-x86_64.exe
Download: [https://cygwin.com/install.html](https://cygwin.com/install.html) and run setup-x86_64.exe for 64 Bit Cygwin, or setup-x86.exe for 32 bit Cygwin. I install into c:\\cygwin64 and c:\\cygwin32
You need:
make, cmake, gcc, pkg-config, dos2unix, zlib-devel, libexpat1-devel, git, python3-interpreter, libiconv, libxml2-utils, libncurses.
make, cmake, gcc, gettext-devel pkg-config, dos2unix, zlib-devel, libexpat1-devel, git, python3-interpreter, libiconv, libxml2-utils, libncurses.
Download and build libiconv-1.15: [https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz](https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz)
Download and build cmake from source because I can't get the cygwin installed cmake 3.6.2 to work.
To build cmake from source, you need libncurses. [https://cmake.org/download/](https://cmake.org/download/)
I use the following batch file to start the Cygwin/64 bit bash shell from the Dos Command Prompt (cmd.exe)
I use the following batch file "cygwin64.bat" to start the Cygwin/64 bit bash shell from the Dos Command Prompt (cmd.exe).
```
```bat
@echo off
setlocal
set "PATH=c:\cygwin64\usr\local\bin;c:\cygwin64\bin;c:\cygwin64\usr\bin;c:\cygwin64\usr\sbin;"
if NOT EXIST %HOME% mkdir %HOME%
set "HOME=c:\cygwin64\home\rmills"
cd %HOME%
set "PS1=\! CYGWIN64:\u@\h:\w \$ "
@ -586,7 +779,7 @@ As well as Microsoft Visual Studio, you will need to install CMake, Python3, and
I use the following batch file to start cmd.exe. I do this to reduce the complexity of the path which grows as various tools are installed on Windows. The purpose of this script is to ensure a "stripped down path".
```
```bat
@echo off
setlocal
cd %HOMEPATH%
@ -596,3 +789,4 @@ cmd
[TOC](#TOC)
Written by Robin Mills<br>robin@clanmills.com<br>Updated: 2018-11-28

@ -1,8 +1,8 @@
Exiv2 v0.27.0.2 (Exiv2 v0.27 RC2)
Exiv2 v0.27.0.3 (Exiv2 v0.27 RC3)
-----------------------------------
We are 95% complete (by issues) 99/109 on GitHub and 88/88 on Redmine
We are 93% complete (by time). Project 2017-05-10 .. 2018-12-28 (86 weeks)
We are 100% complete (by issues) 129/129 on GitHub and 88/88 on Redmine
We are 95% complete (by time). Project 2017-05-10 .. 2018-12-28 (86 weeks)
Exiv2 v0.27 RC3 scheduled 07 December 2018
Exiv2 v0.27 GM scheduled 28 December 2018
@ -19,7 +19,7 @@ The headline features are:
3) Rewritten CMake Support
4) Conan Support to build dependencies
5) Adobe XMPsdk 2016 support
6) New python based test suite
6) New python test suite
7) AppVeyor, Travis, CodeCov and GitLabs monitor submissions
8) Support for MinGW/msys2
9) Jenkins buildserver operates from GitHub
@ -33,19 +33,35 @@ Focus of Exiv2 v0.28
Exiv2 moves into the future with Exiv2 v0.28.
The code will be modernised to C++11.
Users C++98 compilers such as Visual Studio (<2015) will be supported
Using C++98 compilers such as Visual Studio (<2015) will be supported
with quarterly Exiv2 v0.27 'dot' (security) releases during 2019 and 2020.
High Priory Issues
------------------
Known Issues
------------
1 Do not build with GCC 8.2 (7.3 is OK) https://github.com/Exiv2/exiv2/issues/421
2 Do not build with Xcode 10.0 https://bugreport.apple.com/web/?problemID=45223696
Xcode 9.4 and earlier OK https://github.com/Exiv2/exiv2/issues/465
Xcode 10.1 OK https://github.com/Exiv2/exiv2/issues/528
Fixes since RC1
---------------
Fixes between RC2 and RC3
-------------------------
#557 Updates to documentation concerning Debugging, Clang, ccache and Unit Tests.
#557 Build and test logs are stored in build bundles.
#572 Build Server publishes/tests
on Cygwin, MinGW, Linux, Darwin and msvc
in Release/Debug, 64/32, gcc/clang, static/shared.
#369 Revised man page exiv2.1.
#521 Fix del XMP/Region
#570 All compiler warnings have been eliminated.
Web-site refined and polished.
Preparation to rehost exiv2.org
#425 Security fixes (#425, #547, #558, #564)
Something I've forgotten!
Something we'll discover today or tomorrow!
Fixes between RC1 and RC2
-------------------------
#544 Catalonian Language Support
#541 exiv2 -vVg loops
#540 CMake Cleanup
@ -192,4 +208,4 @@ Xmp: (3)
Robin Mills
robin@clanmills.com
2018-11-16
2018-11-29

Loading…
Cancel
Save