Use ecm_optional_add_subdirector for localized data/scripts
ClosedPublic

Authored by ltoscano on Sep 28 2017, 3:50 PM.

Details

Summary

Some source-based distributions remove the translated artifacts
or make them optional depending on some flag. This change makes
sure that the compilation does not fail if po/ is removed.
(the other macros like ki18n_install, kdoctools_install, etc,
already behave as noop if the directory does not exist).

Test Plan

Regenerate a package with localized data (I tried step);
instead of the line add_subdirectory(po) the main CMakeLists.txt
file contains the new lines.

Diff Detail

Repository
R497 Release tools
Branch
Applications/17.08
Lint
No Linters Available
Unit
No Unit Test Coverage
ltoscano created this revision.Sep 28 2017, 3:50 PM
ltoscano edited the test plan for this revision. (Show Details)Sep 28 2017, 4:01 PM
ltoscano added a project: KDE Applications.
ltoscano added subscribers: asturmlechner, aacid, cfeck.

much appreciated!

Looks good, though maybe this is something we want for master in case it breaks it'll break with the 17.12 betas not with 17.08.2?

Just for the record, I feel that it should be safe enough for 17.08 (warning, incoming brain dump):

  • the change from add_subdirectory to ecm_optional_add_subdirectory, when the directory exists, should produce the same behavior;
  • the more problematic part may be include(ECMOptionalAddSubdirectory); from what I understand, it should not be a problem to put it at the end of cmake, even if it is already included. Also, all applications using this depends on ECM.

@cfeck I won't be around to do the 17.08.2 tagging since i'm flying that day, so i guess i'm going to let you decide if we're fine with this being in for 17.08.x or not

cfeck accepted this revision.Sep 29 2017, 11:30 PM

I am fine. This isn't the first time we shipped broken l10n stuff in stable releases :)

Jokes aside, I trust Luigi to fix any regression we find.

This revision is now accepted and ready to land.Sep 29 2017, 11:30 PM
aacid closed this revision.Sep 30 2017, 8:59 AM