I tried to use directly the private OBJECT library (exiv2lib_int) in the unit_tests targets, but the private objects have dependencies on the public symbols (circular dependency)
and therefore it is impossible to test the private code with that approach with the current design of the library.
Starting from CMake 3.3 we can use the variable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to export all the symbols of a shared library:
https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/
Even having the opportunity to use this variable (that will be only used when EXIV2_BUILD_UNIT_TESTS is enabled) the previous commits are still valid.
It is interesting to clearly differentiate between the public and private code of the library. Enforcing this, make us think twice before putting code in the public
part of the library.