Skip to content

Commit

Permalink
Change EXIV2_ENABLE_NLS default to Off, removed EXIV2_BUILD_PO. Docum…
Browse files Browse the repository at this point in the history
…entation Update. Restored find_package(Intl REQUIRED)

(cherry picked from commit 73c592c)
  • Loading branch information
clanmills authored and piponazo committed Jul 28, 2019
1 parent 5b64464 commit 076585d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Expand Up @@ -13,7 +13,7 @@ option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library"
option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON )
option( EXIV2_ENABLE_EXTERNAL_XMP "Use external version of XMP" OFF )
option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON )
cmake_dependent_option(EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON "UNIX" OFF)
option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" OFF )
option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON )
option( EXIV2_ENABLE_LENSDATA "Build including lens data" ON )
option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" ON )
Expand All @@ -22,7 +22,6 @@ option( EXIV2_ENABLE_WEBREADY "Build webready support into library"
option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo (WEBREADY)" OFF )

option( EXIV2_BUILD_SAMPLES "Build sample applications" ON )
option( EXIV2_BUILD_PO "Build translations files" OFF )
option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON )
option( EXIV2_BUILD_UNIT_TESTS "Build unit tests" OFF )
option( EXIV2_BUILD_FUZZ_TESTS "Build fuzz tests (libFuzzer)" OFF )
Expand Down Expand Up @@ -103,7 +102,7 @@ if( EXIV2_BUILD_SAMPLES )
add_dependencies(tests exiv2lib exiv2 ${SAMPLES})
endif()

if( EXIV2_BUILD_PO )
if( EXIV2_ENABLE_NLS )
add_subdirectory( po )
endif()

Expand Down
23 changes: 13 additions & 10 deletions README.md
Expand Up @@ -136,20 +136,22 @@ $ cmake -DBUILD_SHARED_LIBS=On -DEXIV2_ENABLE_NLS=OFF

### 2.4 Dependencies

The following Exiv2 features are enabled by default and require external libraries. You can disable the dependency with CMake options:
The following Exiv2 features require external libraries:

| Feature | Package | cmake option to disable | Availability |
|:-------------------------- |:-------- |:---------------------------- |:----------- |
| PNG image support | zlib | -DEXIV2\_ENABLE\_PNG=Off | [http://zlib.net/](http://zlib.net/) |
| Native language support | gettext | -DEXIV2\_ENABLE\_NLS=Off | [http://www.gnu.org/software/gettext/](http://www.gnu.org/software/gettext/) |
| XMP support | expat | -DEXIV2\_ENABLE\_XMP=Off | [http://expat.sourceforge.net](http://expat.sourceforge.net)/<br/>Use _**Expat 2.2.6**_ and later |
| Feature | Package | Default | To change default | Availability |
|:-------------------------- |:-------- |:--------:| :---------------------------- |:----------- |
| PNG image support | zlib | ON | -DEXIV2\_ENABLE\_PNG=Off | [http://zlib.net/](http://zlib.net/) |
| XMP support | expat | ON | -DEXIV2\_ENABLE\_XMP=Off | [http://expat.sourceforge.net](http://expat.sourceforge.net)/<br/>Use _**Expat 2.2.6**_ and later |
| Natural language system | gettext | OFF | -DEXIV2\_ENABLE\_NLS=On | [http://www.gnu.org/software/gettext/](http://www.gnu.org/software/gettext/) |

On UNIX systems, 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 libraries required to build Exiv2. In the file
`ci/install_dependencies.sh` you can check to the list of packages we install on different Linux distributions. This
file is used to setup some CI images in which we try out the Exiv2 compilation.

Notes about different platforms are included in this document: [Platform Notes](#5)
Natural language system is discussed in more detail here: [Localisation](#2-8)

Notes about different platforms are included here: [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.
Expand Down Expand Up @@ -216,7 +218,6 @@ $

This [repository](https://github.com/piponazo/exiv2Consumer) shows an example of how to consume Exiv2 with CMake.


[TOC](#TOC)
<div id="2-7">

Expand Down Expand Up @@ -249,7 +250,9 @@ g++ -std=c++98 myprogram.cpp -o myprogram $(pkg-config exiv2 --libs --cflags)

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 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 messages files can be found at run-time.
To build localisation support, use the CMake option `-DEXIV2_ENABLE_NLS=ON`. You must install the `gettext` package with your package manager or from source. The `gettext` package is available from [http://www.gnu.org/software/gettext/](http://www.gnu.org/software/gettext/) and includes the library `libintl` and utilities to build localisation files. If CMake produces error messages which mention libintl or gettext, you should verify that the package `gettext` has been correctly built and installed.

You must install the build to test localisation. This ensures that the localisation message files can be found at run-time. You cannot test localisation in the directory `build\bin`.

1) Running exiv2 in another language

Expand Down Expand Up @@ -894,4 +897,4 @@ FreeBSD uses pkg as the package manager. You should install the dependency expa
Written by Robin Mills
Revised: 2019-05-11
Revised: 2019-07-29
7 changes: 1 addition & 6 deletions cmake/findDependencies.cmake
Expand Up @@ -40,13 +40,8 @@ else()
endif ()
endif()


if (EXIV2_ENABLE_NLS)
find_package(Intl)
if ( NOT ${Intl_FOUND} )
message(WARNING "*** EXIV2_ENABLE_NLS has been disabled because libintl is not available ***")
set(EXIV2_ENABLE_NLS Off)
endif()
find_package(Intl REQUIRED)
endif( )

find_package(Iconv)
Expand Down

0 comments on commit 076585d

Please sign in to comment.