Skip to content

cmake: Fix paths with absolute GNUInstallDirs#1263

Merged
piponazo merged 1 commit intoExiv2:masterfrom
jtojnar:fix-paths
Sep 8, 2020
Merged

cmake: Fix paths with absolute GNUInstallDirs#1263
piponazo merged 1 commit intoExiv2:masterfrom
jtojnar:fix-paths

Conversation

@jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Aug 12, 2020

@clanmills clanmills requested a review from piponazo August 12, 2020 16:22
src/exiv2.cpp Outdated
#ifdef EXV_ENABLE_NLS
setlocale(LC_ALL, "");
const std::string localeDir = Exiv2::getProcessPath() + EXV_LOCALEDIR;
const std::string localeDir = EXV_LOCALEDIR[0] == '/' ? EXV_LOCALEDIR : Exiv2::getProcessPath() + "/" + EXV_LOCALEDIR;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nicer to be able to use std::filesystem::path(Exiv2::getProcessPath()) / EXV_LOCALEDIR but that requires C++17:

https://en.cppreference.com/w/cpp/filesystem/path

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only C++11 is allowed currently.

Copy link
Collaborator

@clanmills clanmills Aug 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbeu is correct. Currently Exiv2 v0.27-maintenance is written to the C++98 standard. When it compiles with C++11 or C++14, you should set the flags: -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_FLAGS=-Wno-deprecated. 0.27-maintenance cannot be built with C++17 and later because it uses auto_ptr.

The 'master' branch builds with C++11. When we decide to "modernise" the C++ code, KDE requested that we avoid dependency on C++14 and later.

Exiv2 has always avoided Boost. We want to be able to build Exiv2 with the platform standard C++ compiler and minimal dependencies. To support XMP, we require Expat. To support PNG, we require zlib. Both XMP and PNG are optional. All dependencies (localisation, charset conversions, gtest and curl) are optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I suspected something like that. Fortunately, with conditional expressions it is not that much longer.

@clanmills
Copy link
Collaborator

I'm not an expert on CMake (or anything else for that matter), so I've asked @piponazo to review. I know that something was done concerning GNUInstallDirs in the past.

After this PR has been reviewed and merged, can you submit an equivalent PR to branch 0.27-maintenance which is used to maintain the 0.27 "dots". Until 'master' ships as Exiv2 v0.28, the current "shipping branch" is 0.27-maintenance.

@jtojnar
Copy link
Contributor Author

jtojnar commented Aug 12, 2020

The CI failures look unrelated.

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #1263 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1263   +/-   ##
=======================================
  Coverage   71.91%   71.91%           
=======================================
  Files         152      152           
  Lines       17674    17674           
=======================================
  Hits        12710    12710           
  Misses       4964     4964           
Impacted Files Coverage Δ
src/exiv2.cpp 100.00% <ø> (ø)
src/types.cpp 95.09% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd2d181...064cafb. Read the comment docs.

@tbeu tbeu added the CMake Configuration issues related with CMake label Aug 12, 2020
@tbeu tbeu added this to the v0.28 milestone Aug 12, 2020
@clanmills
Copy link
Collaborator

clanmills commented Aug 12, 2020

Dan set up the the CI and I don't understand it. It fails almost every build for reasons that I usually cannot understand.

I have a build server at home on my MacMini and I build on the 8 supported platforms: Ubuntu, macOS, cygwin/64, MinGW/msys2, msvc2019, solaris, freebsd and netbsd.

The github/CI builds about 50 platforms (suse, fedora and loads of others). It doesn't build some supported platforms (cygwin/64 and MinGW/msys2). Even when the CI is successful, CodeCov is happy to produce other inexplicable build failures.

@jtojnar
Copy link
Contributor Author

jtojnar commented Sep 4, 2020

Do you have plans to release 0.27.4? I could open a PR targetting the maintenance branch to at least fix it there before the next release and leave this until some maintainer of master branch appears.

@clanmills
Copy link
Collaborator

Please submit PRs to branch 0.27-maintenance which is scheduled for release as 0.27.4 in Spring 2021.

It's hard to predict anything, especially the future!

Sadly, I think branch 'master' has died as almost nothing has been contributed in 2020. I returned to the project in March 2020 to finish 0.27.3 on branch 0.27-maintenance. I hoped to motivate the others to use their covid/lockdown time to work on branch 'master'.

@jtojnar
Copy link
Contributor Author

jtojnar commented Sep 4, 2020

Opened #1275

It is not generally true that `CMAKE_INSTALL_<dir>` variables are relative paths:

https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files
https://github.com/jtojnar/cmake-snips#assuming-cmake_install_dir-is-relative-path

Let's join them properly as paths, not strings.

Signed-off-by: Jan Tojnar <jtojnar@gmail.com>

(cherry-picked from 48f2c9d)
Copy link
Collaborator

@piponazo piponazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I never thought about the case of assuming relative paths you explain in one of the links provided ... but it sounds reasonable!

If this has been already merged in 0.27-maintenance without creating troubles, I think it would be also nice to have it in master 😉

@clanmills
Copy link
Collaborator

Great to hear your voice, @piponazo Hope everything's great with you and yours.

I merged #1275 into 0.27-maintenance yesterday. So, you can merge this into 'master'.

I have a super young Chinese guy (23 years old) working with me on the test suite (getting rid of bash). Very pleased with his work. I'm going to get him to do some testing on our Unicode support.

@piponazo piponazo merged commit fd32c47 into Exiv2:master Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake Configuration issues related with CMake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants