summaryrefslogtreecommitdiffstats
path: root/src/opencv-4-reverse-deps-sublist.patch
blob: fbd36dccaf9ca5c73db5b451dc1e722b2092eb40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
This file is part of MXE. See LICENSE.md for licensing information.

From 20cf852345e364f7e18c8721561d7c4d1ebd1d6e Mon Sep 17 00:00:00 2001
From: Boris Nagaev <bnagaev@gmail.com>
Date: Sun, 6 Sep 2015 00:53:13 +0100
Subject: [PATCH] reverse deps list before inserting to another list

Order of items in ${m}_EXTRA_DEPS_${ocv_optkind} corresponds
to the order in which a linker expects items to appear:
a depender before a dependee.

But the order of items of OpenCV_EXTRA_COMPONENTS is
reversed (afterwards this list is unique'ed and reversed).
That is why sub-lists must be inserted in reversed form.
---
 cmake/OpenCVGenPkgconfig.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake
index 183c56d..180210d 100644
--- a/cmake/OpenCVGenPkgconfig.cmake
+++ b/cmake/OpenCVGenPkgconfig.cmake
@@ -19,9 +19,11 @@ endif()
 set(OpenCV_LIB_COMPONENTS "")
 set(OpenCV_EXTRA_COMPONENTS "")
 foreach(m ${OPENCV_MODULES_PUBLIC})
   list(INSERT OpenCV_LIB_COMPONENTS 0 ${${m}_MODULE_DEPS_${ocv_optkind}} ${m})
   if(${m}_EXTRA_DEPS_${ocv_optkind})
+    ocv_list_reverse(${m}_EXTRA_DEPS_${ocv_optkind})
     list(INSERT OpenCV_EXTRA_COMPONENTS 0 ${${m}_EXTRA_DEPS_${ocv_optkind}})
+    ocv_list_reverse(${m}_EXTRA_DEPS_${ocv_optkind})
   endif()
 endforeach()
 
-- 
2.1.4