Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/nightly_Linux_distributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
run: |
mkdir build && cd build
cmake $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ matrix.shared_libraries }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} ..
make -j $(nproc)
make install
cmake --build . --parallel
cmake --install .
2 changes: 1 addition & 1 deletion .github/workflows/on_PR_linux_fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
-DEXIV2_BUILD_FUZZ_TESTS=ON \
-DEXIV2_TEAM_USE_SANITIZERS=ON \
.. && \
cmake --build .
cmake --build . --parallel

- name: Fuzz
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_PR_linux_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ jobs:
-DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON \
-DCMAKE_INSTALL_PREFIX=install \
.. && \
cmake --build .
cmake --build . --parallel

- name: Install
run: |
cd build
cmake --build . --target install
cmake --install .
tree install

- name: Test
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/on_PR_linux_special_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
-DBUILD_WITH_COVERAGE=ON \
-DCMAKE_INSTALL_PREFIX=install \
.. && \
cmake --build .
cmake --build . --parallel

- name: Tests + Upload coverage
run: |
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
run: |
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_ENABLE_BMFF=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DBUILD_WITH_COVERAGE=OFF -DCMAKE_INSTALL_PREFIX=install ..
cmake --build .
cmake --build . --parallel

- name: Tests with valgrind
run: |
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
-DEXIV2_TEAM_USE_SANITIZERS=ON \
-DCMAKE_INSTALL_PREFIX=install \
.. && \
cmake --build .
cmake --build . --parallel

- name: Tests
run: |
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
-DEXIV2_ENABLE_NLS=ON \
-DCMAKE_CXX_FLAGS="-DEXIV2_DEBUG_MESSAGES" \
.. && \
make -j
cmake --build . --parallel

- name: Generate documentation
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_PR_mac_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ jobs:
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
.. && \
cmake --build .
cmake --build . --parallel

- name: Install
run: |
cd build
cmake --build . --target install
cmake --install .

- name: Test
run: |
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/on_PR_windows_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ jobs:
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} `
-DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} `
-DEXIV2_ENABLE_NLS=OFF `
-DEXIV2_ENABLE_WIN_UNICODE=OFF `
-DEXIV2_ENABLE_WEBREADY=ON `
-DEXIV2_ENABLE_BMFF=ON `
-DEXIV2_BUILD_UNIT_TESTS=ON `
-DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON `
-DCMAKE_INSTALL_PREFIX=install `
-S . -B build && `
cmake --build build
cmake --build build --parallel

- name: Install
run: |
Expand All @@ -95,51 +94,51 @@ jobs:

msys2:
runs-on: windows-latest
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
shared_libraries: [ON, OFF]
sys: [MINGW64]
sys: [UCRT64]
name: MSYS2 ${{matrix.sys}} - BuildType:${{matrix.build_type}} - SHARED:${{matrix.shared_libraries}}
defaults:
run:
shell: msys2 {0}

steps:
- uses: actions/checkout@v2

- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
path-type: strict
msystem: ${{matrix.sys}}
update: true
install: >-
base-devel
pacboy: >-
toolchain:p
cmake:p
ninja:p
expat:p
gettext:p
gtest:p
libiconv:p
python-lxml:p
zlib:p

- name: Build
run: |
cmake -GNinja \
cmake -G"MSYS Makefiles" \
-DCMAKE_CXX_FLAGS=-Wno-deprecated \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} \
-DEXIV2_BUILD_SAMPLES=ON \
-DEXIV2_ENABLE_NLS=ON \
-DEXIV2_ENABLE_WIN_UNICODE=ON \
-DEXIV2_ENABLE_NLS=OFF \
-DEXIV2_ENABLE_WEBREADY=ON \
-DEXIV2_ENABLE_BMFF=ON \
-DEXIV2_BUILD_UNIT_TESTS=ON \
-S . -B build && \
cmake --build build
cmake --build build --parallel

- name: Test
run: |
Expand Down Expand Up @@ -190,7 +189,7 @@ jobs:
-DEXIV2_ENABLE_BMFF=ON \
-DEXIV2_BUILD_UNIT_TESTS=OFF \
-S . -B build && \
cmake --build build
cmake --build build --parallel

- name: Test
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/on_push_BasicWinLinMac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
-DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON `
-DCMAKE_INSTALL_PREFIX=install .. `
-S . -B build && `
cmake --build build
cmake --build build --parallel


- name: Test
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
-DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON \
-DCMAKE_INSTALL_PREFIX=install \
.. && \
cmake --build .
cmake --build . --parallel

- name: Test
run: |
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
.. && \
cmake --build .
cmake --build . --parallel

- name: Test
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_push_ExtraJobsForMain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
-DBUILD_WITH_COVERAGE=ON \
-DCMAKE_INSTALL_PREFIX=install \
.. && \
make -j
cmake --build . --parallel

- name: Tests + Upload coverage
run: |
Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project(exiv2 # use TWEAK to categorize the build
# 1.00.0.20 = RC2 Preview
# 1.00.0.29 = RC2 Development
DESCRIPTION "Exif/IPTC/Xmp C++ metadata library and tools plus ICC Profiles, Previews and more."
LANGUAGES CXX
LANGUAGES C CXX
)

if(NOT CMAKE_BUILD_TYPE)
Expand All @@ -24,10 +24,8 @@ option( EXIV2_ENABLE_XMP "Build with XMP metadata support"
option( EXIV2_ENABLE_EXTERNAL_XMP "Use external version of XMP" OFF )
option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON )
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 )
option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF )
option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF )
option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo (WEBREADY)" OFF )
option( EXIV2_ENABLE_BMFF "Build with BMFF support" ON )
Expand Down
66 changes: 30 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1114,53 +1114,45 @@ I recommend that you build and install CMake from source.

## MinGW/msys2

Please note that the platform MinGW/msys2 32 is obsolete and superceded by MinGW/msys2 64.
Please note that the platform MinGW/msys2 32 is obsolete and superceded by MinGW/msys2 64. It is important to highlight that we rely on using the Universal C Runtime (UCRT) and its relatively new support for UTF-8. Check this [PR](https://github.com/Exiv2/exiv2/pull/2090) for more information. Therefore you will need to use the [URCT MSYS environment](https://www.msys2.org/docs/environments/).

### MinGW/msys2 64 bit
Install the latest version of [MSYS2](https://repo.msys2.org/distrib/msys2-x86_64-latest.exe)
Install the latest version of [MSYS2](https://repo.msys2.org/distrib/msys2-x86_64-latest.exe), and follow the installation instructions available [here](https://www.msys2.org/).

The CI workflow file `.github/workflows/on_PR_windows_matrix.yml` has a build job named `msys2` with instructions showing how to configure Exiv2 on MinGW/msys2.

I use the following batch file to start the MinGW/msys2 64 bit bash shell from the Dos Command Prompt (cmd.exe)
### Install exiv2 Dependencies

```bat
@echo off
setlocal
set "PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;c:\msys64\usr\local\bin;"
set "PS1=\! MSYS \u@\h:\w \$ "
set "HOME=c:\msys64\home\rmills"
if NOT EXIST %HOME% mkdir %HOME%
cd %HOME%
color 1f
c:\msys64\usr\bin\bash.exe -norc
endlocal

```

### Install MinGW Dependencies

Install tools and dependencies:
Please note that you will need to install the `ucrt` package version of the exiv2 dependencies:

```bash
for i in base-devel git coreutils dos2unix tar diffutils make \
mingw-w64-x86_64-toolchain mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb \
mingw-w64-x86_64-cmake mingw-w64-x86_64-gettext mingw-w64-x86_64-python3 \
mingw-w64-x86_64-libexpat mingw-w64-x86_64-libiconv mingw-w64-x86_64-zlib \
mingw-w64-x86_64-gtest
do (echo y | pacman -S $i) ; done
pacman -S mingw-w64-ucrt-x86_64-binutils mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-curl mingw-w64-ucrt-x86_64-expat mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gettext mingw-w64-ucrt-x86_64-gtest mingw-w64-ucrt-x86_64-libiconv mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-x86_64-zlib
```

### Download exiv2 from github and build

Use the Windows start menu to open the terminal customized for the UCRT environment: `MSYS2 MinGW UCRT x64`. Then run the following commands to download exiv2, configure the project and build it:

```bash
$ mkdir -p ~/gnu/github/exiv2
$ cd ~/gnu/github/exiv2
$ git clone https://github.com/exiv2/exiv2
$ cd exiv2
$ mkdir build ; cd build ;
$ cmake .. -G "Unix Makefiles" # or "MSYS Makefiles"
$ make
```
mkdir -p ~/gnu/github/exiv2
cd ~/gnu/github/exiv2
git clone https://github.com/exiv2/exiv2
cd exiv2
mkdir build && cd build
cmake -G "MSYS Makefiles"
-DCMAKE_CXX_FLAGS=-Wno-deprecated
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DEXIV2_BUILD_SAMPLES=ON
-DEXIV2_ENABLE_NLS=OFF
-DEXIV2_ENABLE_WEBREADY=ON
-DEXIV2_ENABLE_BMFF=ON
-DEXIV2_BUILD_UNIT_TESTS=ON
..

cmake --build . --parallel
```

The binaries generated at this point can be executed from the MSYS2 UCRT terminal, but they will not run from a Windows Command Prompt or PowerShell. The reason is that the MSYS2 UCRT 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.

[TOC](#TOC)
<div id="PlatformCygwin">
Expand Down Expand Up @@ -1197,7 +1189,7 @@ endlocal

## Visual Studio

We recommend that you use Conan to build Exiv2 using Visual Studio. Exiv2 v0.27 can be built with Visual Studio versions 2008 and later. We actively support and build with Visual Studio 2015, 2017 and 2019.
We recommend that you use Conan to get the Exiv2 dependencies when using Visual Studio. Exiv2 v0.27 can be built with Visual Studio versions 2008 and later. For the `main` branch we actively support and build with Visual Studio 2019 and 2022.

As well as Visual Studio, you will need to install CMake, Python3, and Conan.

Expand All @@ -1212,6 +1204,8 @@ As well as Visual Studio, you will need to install CMake, Python3, and Conan.

The python3 interpreter must be on your PATH.

It is important to highlight that we rely on using of the Universal C Runtime (UCRT) and its relatively new support for UTF-8. Check this [PR](https://github.com/Exiv2/exiv2/pull/2090) for more information.

[TOC](#TOC)
<div id="PlatformUnix">

Expand Down
12 changes: 3 additions & 9 deletions cmake/compilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,7 @@ if(MSVC)
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif ()

# Object Level Parallelism
add_compile_options(/MP)
add_definitions(-DNOMINMAX) # This definition is not only needed for Exiv2 but also for xmpsdk

# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
if (MSVC_VERSION GREATER_EQUAL "1910") # VS2017 and up
add_compile_options("/Zc:__cplusplus")
endif()

add_compile_options(/MP) # Object Level Parallelism
add_compile_options(/utf-8) # Set source and execution character sets to UTF-8
add_definitions(-DNOMINMAX) # This definition is not only needed for Exiv2 but also for xmpsdk
endif()
6 changes: 0 additions & 6 deletions cmake/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
// Define if the strerror_r function returns char*.
#cmakedefine EXV_STRERROR_R_CHAR_P

// Define to enable the Windows unicode path support.
#cmakedefine EXV_UNICODE_PATH

/* Define to `const' or to empty, depending on the second argument of `iconv'. */
#cmakedefine ICONV_ACCEPTS_CONST_INPUT
#if defined(ICONV_ACCEPTS_CONST_INPUT) || defined(__NetBSD__)
Expand Down Expand Up @@ -76,7 +73,4 @@
// Define if you have the iconv function.
#cmakedefine EXV_HAVE_ICONV

// Definition to enable conversion of UCS2 encoded Windows tags to UTF-8.
#cmakedefine EXV_HAVE_PRINTUCS2

#endif /* !_EXV_CONF_H_ */
2 changes: 0 additions & 2 deletions cmake/generateConfigFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ endif()
set(EXV_ENABLE_BMFF ${EXIV2_ENABLE_BMFF})
set(EXV_ENABLE_WEBREADY ${EXIV2_ENABLE_WEBREADY})
set(EXV_HAVE_LENSDATA ${EXIV2_ENABLE_LENSDATA})
set(EXV_HAVE_PRINTUCS2 ${EXIV2_ENABLE_PRINTUCS2})

set(EXV_PACKAGE_NAME ${PROJECT_NAME})
set(EXV_PACKAGE_VERSION ${PROJECT_VERSION})
Expand All @@ -21,7 +20,6 @@ else()
endif()
set(EXV_HAVE_ICONV ${ICONV_FOUND})
set(EXV_HAVE_LIBZ ${ZLIB_FOUND})
set(EXV_UNICODE_PATH ${EXIV2_ENABLE_WIN_UNICODE})

check_cxx_symbol_exists(mmap sys/mman.h EXV_HAVE_MMAP )
check_cxx_symbol_exists(munmap sys/mman.h EXV_HAVE_MUNMAP )
Expand Down
2 changes: 0 additions & 2 deletions cmake/printSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ else()
endif()
OptionOutput( "Building BMFF support: " EXIV2_ENABLE_BMFF )
OptionOutput( "Native language support: " EXIV2_ENABLE_NLS )
OptionOutput( "Conversion of Windows XP tags: " EXIV2_ENABLE_PRINTUCS2 )
OptionOutput( "Nikon lens database: " EXIV2_ENABLE_LENSDATA )
OptionOutput( "Building webready support: " EXIV2_ENABLE_WEBREADY )
if ( EXIV2_ENABLE_WEBREADY )
Expand All @@ -61,7 +60,6 @@ endif ( EXIV2_ENABLE_WEBREADY )

if (WIN32)
OptionOutput( "Dynamic runtime override: " EXIV2_ENABLE_DYNAMIC_RUNTIME)
OptionOutput( "Unicode paths (wstring): " EXIV2_ENABLE_WIN_UNICODE )
endif()
OptionOutput( "Building exiv2 command: " EXIV2_BUILD_EXIV2_COMMAND )
OptionOutput( "Building samples: " EXIV2_BUILD_SAMPLES )
Expand Down
2 changes: 1 addition & 1 deletion cmake/toolchain/Ubuntu20_04_mingw-w64-x86_64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# *) install zlib for mingw: sudo apt install libz-mingw-w64-dev
# *) mkdir buildMinGWRelease && cd buildMinGWRelease
# *) cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain/Ubuntu20_04_mingw-w64-x86_64.cmake
# -DEXIV2_ENABLE_XMP=OFF -DEXIV2_TEAM_EXTRA_WARNINGS=ON -DEXIV2_ENABLE_WIN_UNICODE=ON
# -DEXIV2_ENABLE_XMP=OFF -DEXIV2_TEAM_EXTRA_WARNINGS=ON

set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
Expand Down
Loading