D7187: RFC: Make ECMAddTests respect BUILD_TESTING
Kevin Funk
noreply at phabricator.kde.org
Mon Aug 7 14:44:27 UTC 2017
kfunk added a comment.
In https://phabricator.kde.org/D7187#133358, @elvisangelaccio wrote:
> In `ecm_mark_as_test` (which is used in `ecm_add_test`) we already disable the target if `BUILD_TESTING` is false, why is that not enough?
Good question. I didn't explain that in the commit message:
`ecm_add_test` also invokes `target_link_libraries(...)` which may pull in additionally dependencies if `BUILD_TESTING=ON`.
Example:
ecm_add_test(test_svnrecursiveadd.cpp LINK_LIBRARIES
Qt5::Test Qt5::Gui
)
- If `BUILD_TESTING=OFF` & without this patch: We still need Qt5::Test around.
- If `BUILD_TESTING=OFF` & with this patch: We no longer need Qt5::Test at all.
This patch actually makes it pretty easy to get rid off the Qt5::Test dependency in a whole KDE project without touching lots of CMake code.
REPOSITORY
R240 Extra CMake Modules
REVISION DETAIL
https://phabricator.kde.org/D7187
To: kfunk
Cc: elvisangelaccio, asturmlechner, apol, #frameworks, #build_system
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20170807/e49a00ba/attachment.html>
More information about the Kde-buildsystem
mailing list