@ -82,11 +82,11 @@ You need [CMake](https://cmake.org/download/) to configure the Exiv2 project, an
```bash
$ cd ~/gnu/github/exiv2 # Location of the project code
$ mkdir build && cd build # Create a build directory
$ cmake -DCMAKE_BUILD_TYPE=Release .. # Configure the project with CMake
$ cmake --build . # Compile the project
$ ctest --verbose # Run tests
$ cmake --install . # Run the install target (install library, public headers, application and CMake files)
$ rm -r build # Remove existing build directory
$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release # Configure the project with CMake
$ cmake --build build # Compile the project
$ ctest --test-dir build --verbose # Run tests
$ sudo cmake --install build # Run the install target (install library, public headers, application and CMake files)
```
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`. The target directory for the installation can be modified by using the CMake option `-DCMAKE_INSTALL_PREFIX`.
@ -115,7 +115,7 @@ I don't know why anybody would uninstall Exiv2.
```bash
$ cd ~/gnu/github/exiv2 # location of the project code
$ cd build
$ cmake --build . --target uninstall
$ cmake --build build --target uninstall
```
These commands will run the `uninstall` target and remove all the files which were installed by the `install` target.
@ -133,9 +133,9 @@ See [README-CONAN](README-CONAN.md) for more information about Conan.
When you build, you may install with the following command.
```cmd
> cmake --install .
> cmake --install build
```
This will create and copy the exiv2 build artefacts to `%ProgramFiles%/exiv2`. To be able to run the `exiv2` command line application from any terminal you should modify your path to include `%ProgramFiles%/exiv2/bin`.
This will create and copy the exiv2 build artifacts to `%ProgramFiles%/exiv2`. To be able to run the `exiv2` command line application from any terminal you should modify your path to include `%ProgramFiles%/exiv2/bin`.
[TOC](#TOC)
<divid="CMakePresets">
@ -489,7 +489,7 @@ Additionally, you will require an additional build step to actually build the do
```bash
$ cmake ..options.. -DEXIV2_BUILD_DOC=ON
$ cmake --build . --target doc
$ cmake --build build --target doc
```
To build the documentation, you must install the following products:
@ -547,15 +547,14 @@ Create and build exiv2 for your platform.
@ -639,14 +636,14 @@ and runs on Windows, Mac and Linux. It has excellent integration with CMake and
add **`-DCMAKE_BUILD_TYPE=Debug`** to the CMake command. It keeps build types in separate directories
such as **`<exiv2dir>/cmake-build-debug`**.
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.
With the Unix Makefile generator, the targets can be listed:
```bash
$ cmake --build . --target 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
@ -664,9 +661,9 @@ The following are some of the valid targets for this Makefile:
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)
@ -955,13 +952,13 @@ For new bug reports, feature requests and support: Please open an issue in Gith
# Test Suite
You execute the Test Suite using CTest with the command `$ ctest`.
You execute the Test Suite using CTest with the command `$ ctest --test-dir build`.
The build creates 6 tests: bashTests, bugfixTests, lensTests, tiffTests, unitTests and versionTests. You can run all tests or a subset. To list all available tests, execute ctest with the `-N` or `--show-only` option, which disables execution:
```bash
.../main/build $ ctest -N
Test project ...main/build
.../exiv2/ $ ctest --test-dir build --show-only
Test project ...main/exiv2
Test #1: bashTests
Test #2: bugfixTests
Test #3: lensTests
@ -970,16 +967,16 @@ Test project ...main/build
Test #6: unitTests
Total Tests: 6
.../main/build $
.../exiv2 $
```
ctest provides many option and the following show common use-case scenarios:
```bash
$ ctest # run all tests and display summary
$ ctest --output-on-failure # run all tests and output failures
$ ctest -R bugfix # run only bugfixTests and display summary
$ ctest -R bugfix --verbose # run only bugfixTests and display all output
$ ctest --test-dir build # run all tests and display summary
$ ctest --test-dir build --output-on-failure # run all tests and output failures
$ ctest --test-dir build-R bugfix # run only bugfixTests and display summary
$ ctest --test-dir build -R bugfix --verbose # run only bugfixTests and display all output
```
Except for the `unitTests`, CMake needs to find a python3 interpreter in the system to be able to run the rest of the test targets with CTest:
@ -1025,11 +1022,11 @@ The Variable EXIV2\_PORT or EXIV2\_HTTP can be set to None to skip http tests.
The binaries generated at this point can be executed from the MSYS2 UCRT64 terminal, but they will not run from a Windows Command Prompt or PowerShell. The reason is that the MSYS2 UCRT64 terminal is properly configured to find some needed DLLs. In case you want to be able to run the generated **exiv2** binary from any Windows terminal, you'll need to deploy the needed DLLs with the application.