Use CMake find_dependency in CMake config file instead of find_package
ClosedPublic

Authored by daandemeyer on Aug 16 2019, 5:33 PM.

Details

Summary

find_dependency is preferred in config files to correctly propagate the QUIET and REQUIRED parameters from the enclosing find_package call. See https://cmake.org/cmake/help/v3.0/module/CMakeFindDependencyMacro.html#module:CMakeFindDependencyMacro.

The macro does not support COMPONENTS before CMake 3.8 so I split the original find_package up into two find_dependency calls. I also removed the NO_MODULE parameter. This is consistent with how the rest of KDE uses find_dependency.

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
daandemeyer created this revision.Aug 16 2019, 5:33 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptAug 16 2019, 5:33 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
daandemeyer requested review of this revision.Aug 16 2019, 5:33 PM
dhaumann accepted this revision.Aug 17 2019, 6:30 AM
This revision is now accepted and ready to land.Aug 17 2019, 6:30 AM
krop added a subscriber: krop.Aug 17 2019, 6:41 AM
krop added inline comments.
KF5SyntaxHighlightingConfig.cmake.in
4–5

Please use REQUIRED_QT_VERSION defined in the top CMakeLists.txt instead of these Qt5Core_VERSION_*

Use REQUIRED_QT_VERSION to specifiy required Qt version.

daandemeyer marked an inline comment as done.Aug 17 2019, 11:22 AM
krop accepted this revision.Aug 17 2019, 1:51 PM
This revision was automatically updated to reflect the committed changes.