Bug 382952 - Don't abort cmake when package is missing
Summary: Don't abort cmake when package is missing
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Cmake (show other bugs)
Version: 5.7.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-31 10:32 UTC by Simon
Modified: 2017-08-06 23:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.7.0


Attachments
Don't abort until all dependencies were checked (9.01 KB, patch)
2017-07-31 21:12 UTC, Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2017-07-31 10:32:05 UTC
Many calls to find_package have have the argument 'REQUIRED' set, so the process aborts if these can't be found. At the same time there is an explicit check at the end that all required dependencies were found.
This is redundant and only the first missing dependency is displayed, making it harder to resolve all dependencies. I propose to remove all the 'REQUIRED' arguments (obviously making sure the check in the end includes these dependencies). Is there problem with that or can I go ahead?
Comment 1 Veaceslav Munteanu 2017-07-31 15:31:56 UTC
On my archlinux system, opencv 2 is not even available anymore in the official repos. I think that opencv 2 was set since long time ago, and if the bootstrap enables it, we should also enable it.
Comment 2 caulier.gilles 2017-07-31 16:02:06 UTC
Please list the the famous problematic dependencies.

Look also the full DEPENDENCIES list with comments given in digiKam-SC repository :

https://cgit.kde.org/digikam-software-compilation.git/tree/DEPENDENCIES

Gilles Caulier
Comment 3 Simon 2017-07-31 16:18:37 UTC
I don't have a problem with the dependencies, I think this is a problem of the CMakeList.txt file.
It should not stop processing when a required dependency is not found. Example:
https://cgit.kde.org/digikam.git/tree/CMakeLists.txt?id=7e00441c257e7e9e5dc5ab983fc06046fb72b0c5#n205

It should simply print an error message and continue until here:
https://cgit.kde.org/digikam.git/tree/CMakeLists.txt?id=7e00441c257e7e9e5dc5ab983fc06046fb72b0c5#n482
Where it stops because a required dependency isn't found.

Is this sound or am I missing anything?
Comment 4 Simon 2017-07-31 21:12:32 UTC
Created attachment 106997 [details]
Don't abort until all dependencies were checked
Comment 5 Simon 2017-08-02 09:24:39 UTC
Git commit e3c85fbd1fa892fbf821804fd892b81d00b4bb7b by Simon Frei.
Committed on 02/08/2017 at 09:23.
Pushed by sfrei into branch 'master'.

cmake: Don't abort until all dependencies have checked

In effect this means: Never using the REQUIRED parameter to find_package.
Only exception: ECM, as finding dependencies doesn't work without it.
FIXED-IN: 5.7.0

M  +25   -24   CMakeLists.txt
M  +2    -1    NEWS
M  +29   -29   cmake/modules/MacroOpenCV.cmake
M  +3    -3    cmake/modules/MacroUtils.cmake

https://commits.kde.org/digikam/e3c85fbd1fa892fbf821804fd892b81d00b4bb7b
Comment 6 Ahmed Fathi 2017-08-06 23:49:38 UTC
Git commit e99d0867a27dd3c5853d541905406c938ef4323c by Ahmed Fathi Shaban, on behalf of Simon Frei.
Committed on 06/08/2017 at 23:14.
Pushed by ahmedfathy into branch 'gsoc17-dlna'.

cmake: Don't abort until all dependencies have checked

In effect this means: Never using the REQUIRED parameter to find_package.
Only exception: ECM, as finding dependencies doesn't work without it.
FIXED-IN: 5.7.0

M  +25   -24   CMakeLists.txt
M  +2    -1    NEWS
M  +29   -29   cmake/modules/MacroOpenCV.cmake
M  +3    -3    cmake/modules/MacroUtils.cmake

https://commits.kde.org/digikam/e99d0867a27dd3c5853d541905406c938ef4323c