Set CMAKE_*_OUTPUT_DIRECTORY to run tests without installing.
ClosedPublic

Authored by dfaure on Aug 8 2017, 8:46 AM.

Details

Summary

For compatibility reasons, this is only enabled when projects
upgrade their find_package(ECM) line to request a version >= 5.38.
A little bit like cmake policies: just upgrading ECM is compatible,
while increasing the required version can change behaviour.

Test Plan

Tested make test in all KF5 frameworks; I have patches
for some of them which I can't commit until this is in.

Diff Detail

Repository
R240 Extra CMake Modules
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure created this revision.Aug 8 2017, 8:46 AM
Restricted Application added projects: Frameworks, Build System. · View Herald TranscriptAug 8 2017, 8:46 AM
krop accepted this revision.Aug 9 2017, 10:04 AM
This revision is now accepted and ready to land.Aug 9 2017, 10:04 AM
kfunk accepted this revision.Aug 9 2017, 12:50 PM
kfunk added a subscriber: kfunk.

I like the initiative, +1

dfaure closed this revision.Aug 9 2017, 5:17 PM
aacid added a subscriber: aacid.Aug 9 2017, 10:26 PM

You broke all the builds

krop added a comment.EditedAug 9 2017, 11:34 PM

Fixed with 7e7b6da

krop added a comment.Aug 9 2017, 11:52 PM
In D7198#134234, @cgiboudeaux wrote:

Fixed with 7e7b6da

(+ ef01c93)

Ooops, sorry. I had heavily tested ... a somewhat different version of the patch :(

Thanks for the fixes.

kossebau reopened this revision.Aug 30 2017, 3:00 AM
kossebau added a subscriber: kossebau.
kossebau added inline comments.
kde-modules/KDECMakeSettings.cmake
46–47

Trying to fix things for kdevelop tests, I have to report that as user of ECM this note does not really assist me, besides hinting there is random magic happening :(

So could you please add a comment telling what is that "layout" like, how does it help exactly running executables without installing? What other pre-conditions are need to be met? How should one rely on that layout in own cmake code?

Commits like D7347 which make use of the here undocumented ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} and then also point to yet another documentation source, on community.kde.org, instead of these docs, indicate things need some work here.

This revision is now accepted and ready to land.Aug 30 2017, 3:00 AM

Patch for more docu: https://phabricator.kde.org/D7612

BTW CMAKE_LIBRARY_OUTPUT_DIRECTORY is not undocumented, it's part of the cmake documentation:

Where to put all the :ref:`LIBRARY <Library Output Artifacts>`
target files when built.

This variable is used to initialize the ``LIBRARY_OUTPUT_DIRECTORY``
property on all the targets.  See that target property for additional
information.
aacid closed this revision.Sep 5 2017, 8:49 PM

Seems you commited this but forgot to close this?