+
+## Building Exiv2 Documentation
Building documentation requires installing special tools. You will probably prefer to
read the documentation on-line from the project website: https://exiv2.org
-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
+$ cmake ..options.. -DEXIV2_BUILD_DOC=ON
+$ cmake --build build --target doc
```
To build the documentation, you must install the following products:
| Product | Availability |
|:------------ |:------------ |
-| 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/) |
+| doxygen
graphviz
python
xsltproc
md5sum | [https://www.doxygen.nl/](https://www.doxygen.nl/)
[https://www.graphviz.org/](https://www.graphviz.org/)
[https://www.python.org/](https://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)
+
+
+## Building Exiv2 Tag Webpages
+
+Exiv2 provides many built-in metadata tags which are listed in the sub-pages of https://exiv2.org/metadata.html
+and https://pre-release.exiv2.org/metadata.html. Those tag webpages are generated using tag information
+extracted from the Exiv2 source code.
+
+The tag webpage build files are in the `
/doc/templates` directory. If changes are made to
+tag groups in the Exiv2 source code then the build files need to be updated. Any changes made
+to individual tags in an existing tag group are automatically included.
+
+Building the tag webpages requires building the Exiv2 sample programs and using scripts which have additional dependencies on
+[BASH](https://www.gnu.org/software/bash/), [make](https://manpages.org/make), [xsltproc](https://manpages.org/xsltproc)
+and [Python3](https://www.python.org/).
+
+To build the tag webpages, first [build Exiv2 from source](#TOC) with the `-DEXIV2_BUILD_SAMPLES=ON`
+option enabled. This is required as the [taglist](README-SAMPLES.md#taglist) sample program is used by one of the scripts.
+
+Next, set the `EXIV2_BINDIR` environment variable (see [Exiv2 environment variables](#EnvironmentVariables)).
+
+Then, change directory to `doc/templates` and run `make`.
+
+```bash
+$ cd /doc/templates
+$ make
+```
+
+After processing, the generated webpages are stored in the `/doc/templates` directory.
+When the Exiv2 websites are updated, the generated tag webpages are reformatted before use.
[TOC](#TOC)
-
-### 2.10 Building Exiv2 Packages
+
+
+## Building Exiv2 Packages
-To enable the building of Exiv2 packages, use the CMake option `-DEXIV2_TEAM_PACKAGING=On`.
+To enable the building of Exiv2 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.
-There are two types of Exiv2 packages which are generated by cpack from the cmake command-line.
+There are two types of Exiv2 packages which are generated by cpack from the CMake command-line.
1) Platform Package (header files, binary library and samples. Some documentation and release notes)
@@ -393,15 +540,14 @@ Create and build exiv2 for your platform.
```bash
$ git clone https://github.com/exiv2/exiv2
-$ mkdir -p exiv2/build
-$ cd exiv2/build
-$ cmake .. -G "Unix Makefiles" -DEXIV2_TEAM_PACKAGING=On
+$ cd exiv2
+$ cmake -S . -B build -G "Unix Makefiles" -DEXIV2_TEAM_PACKAGING=ON
...
-- Build files have been written to: .../build
-$ cmake --build . --config Release
+$ cmake --build build --config Release
...
[100%] Built target addmoddel
-$ make package
+$ cmake --build build --target package
...
CPack: - package: /path/to/exiv2/build/exiv2-0.27.1-Linux.tar.gz generated.
```
@@ -409,29 +555,25 @@ CPack: - package: /path/to/exiv2/build/exiv2-0.27.1-Linux.tar.gz generated.
2) Source Package
```bash
-$ make package_source
+$ cmake --build build --target package_source
Run CPack packaging tool for source...
...
CPack: - package: /path/to/exiv2/build/exiv2-0.27.1-Source.tar.gz generated.
```
-You may prefer to run `$ cmake --build . --config Release --target package_source`
-
-
[TOC](#TOC)
-
-### 2.11 Debugging Exiv2
+
+
+## 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.
+In general to generate a debug library, you should use the *CMake* option `-DCMAKE_RELEASE_TYPE=Debug` and build in the usual way.
```bash
$ cd
-$ mkdir build
-$ cd build
-$ cmake .. -G "Unix Makefiles" "-DCMAKE_BUILD_TYPE=Debug"
-$ make
+$ cmake -S . -B build -G "Unix Makefiles" "-DCMAKE_BUILD_TYPE=Debug"
+$ cmake --build build
```
@@ -445,9 +587,6 @@ exiv2 0.27.1
debug=1
$
```
-
-[TOC](#TOC)
-
2) About preprocessor symbols `NDEBUG` and `EXIV2_DEBUG_MESSAGES`
Exiv2 respects the symbol `NDEBUG` which is set only for Release builds. There are sequences of code which are defined within:
@@ -462,18 +601,16 @@ Those blocks of code are not compiled unless you define `EXIV2_DEBUG_MESSAGES`.
```bash
$ cd
-$ touch src/webpimage.cpp
-$ make CXXFLAGS=-DEXIV2_DEBUG_MESSAGES
+$ cmake -S . -B build -DCMAKE_CXX_FLAGS=-DEXIV2_DEBUG_MESSAGES
+$ cmake --build build
$ bin/exiv2 ...
-- or --
-$ sudo make install
+$ cmake --install build
$ exiv2 ...
```
If you are debugging library code, it is recommended that you use the exiv2 command-line program 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:
@@ -482,8 +619,6 @@ This is platform specific. On Linux:
$ 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.
@@ -491,19 +626,17 @@ I have used all those IDEs to debug the Exiv2 library and applications. All of
I work on macOS and use Xcode to develop Exiv2. For a couple of years, Team Exiv2 had free
open-source licences from JetBrains for CLion. I really liked CLion as it is cross platform
and runs on Windows, Mac and Linux. It has excellent integration with CMake and will automatically
-add **`-DCMAKE_BUILD_TYPE=Debug`** to the cmake command. It keeps build types in separate directories
+add **`-DCMAKE_BUILD_TYPE=Debug`** to the CMake command. It keeps build types in separate directories
such as **`/cmake-build-debug`**.
-[TOC](#TOC)
-
-5) cmake --build . options **`--config Release|Debug`** and **`--target install`**
+5) cmake --build 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 cmake 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.
+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 CMake 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
+$ cmake --build build --target help
The following are some of the valid targets for this Makefile:
... all (the default if no target is provided)
... clean
@@ -513,16 +646,17 @@ The following are some of the valid targets for this Makefile:
```
[TOC](#TOC)
-
-### 2.12 Building Exiv2 with **clang** and other build chains
+
+
+## Building Exiv2 with **clang** and other build chains
1) On Linux
```bash
$ cd
-$ rm -rf build ; mkdir build ; cd build
-$ cmake .. -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++)
-$ cmake --build .
+$ rm -rf build
+$ cmake -S . -B build -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++)
+$ cmake --build build
```
**_OR_**
@@ -531,9 +665,9 @@ $ cmake --build .
$ export CC=$(which clang)
$ export CXX=$(which clang++)
$ cd
-$ rm -rf build ; mkdir build ; cd build
-$ cmake ..
-$ cmake --build .
+$ rm -rf build
+$ cmake -S . -B build
+$ cmake --build build
```
2) On macOS
@@ -545,8 +679,9 @@ Apple provide clang with Xcode. GCC has not been supported by Apple since 2013.
I have been unable to get clang to work on any of those platforms.
[TOC](#TOC)
-
-### 2.13 Building Exiv2 with ccache
+
+
+## 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.
@@ -556,23 +691,23 @@ Installing and using ccache (and other similar utilities), is platform dependent
$ sudo apt install --yes ccache
```
-To build with ccache, use the cmake option **-DBUILD\_WITH\_CCACHE=On**
+To build with ccache, use the CMake option **-DBUILD\_WITH\_CCACHE=ON**
```bash
$ cd
-$ mkdir build ; cd build ; cd build
-$ cmake .. -G "Unix Makefiles" -DBUILD_WITH_CCACHE=On
-$ make
+$ cmake -S . -B build -G "Unix Makefiles" -DBUILD_WITH_CCACHE=ON
+$ cmake --build build
# Build again to appreciate the performance gain
-$ make clean
-$ make
+$ cmake --build build --target clean
+$ cmake --build build
```
-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)
+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)
-
-### 2.14 Thread Safety
+
+
+## Thread Safety
Exiv2 heavily relies on standard C++ containers. Static or global variables are used read-only, with the exception of the XMP namespace registration function (see below). Thus Exiv2 is thread safe in the same sense as C++ containers:
Different instances of the same class can safely be used concurrently in multiple threads.
@@ -589,17 +724,14 @@ int main(int argc, const char* argv[])
{
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
-#ifdef EXV_ENABLE_BMFF
- Exiv2::enableBMFF(true);
-#endif
...
}
```
-The use of the _**thread unsafe function**_ Exiv2::enableBMFF(true) is discussed in [2.19 Support for bmff files](#2-19)
[TOC](#TOC)
-
-### 2.15 Library Initialisation and Cleanup
+
+
+## Library Initialisation and Cleanup
As discussed in the section on Thread Safety, Exiv2 classes for Exif and IPTC metadata are fully reentrant and require no initialisation or cleanup.
@@ -610,26 +742,24 @@ The exiv2 command-line program and sample applications call the following at the
```cpp
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
-#ifdef EXV_ENABLE_BMFF
- Exiv2::enableBMFF(true);
-#endif
```
[TOC](#TOC)
-
-### 2.16 Cross Platform Build and Test on Linux for MinGW
+