highgui CMakeLists.txt: ocv_list_unique makes for incorrect linking (Bug #2324)
Description
In the highgui module's CMakeLists.txt, there is a command which filters the list of libraries for linking so that it is a unique list. The problem with this is that CMake library link lists can look something like this:
debug C:/dev/libs/QtCored4.lib optimized C:/dev/libs/QtCore4.lib
debug C:/dev/libs/QtGuid4.lib optimized C:/dev/libs/QtGui4.lib
The order of these options is essential, and after running through ocv_list_unique, all the duplicate entries of "debug" and "optimized" are removed, resulting in linking some release libraries in debug builds and debug libraries in release builds, depending on how the list was sorted and which library the linker encounters first (or last?).
I have attached a patch which fixes the issue but it needs to be reviewed. I don't know why that ocv_list_unique was there in the first place, but my fix is simply to remove it. Maybe that is enough and it works for me.
Related issues
related to Bug #2255: Cannot show image in debug mode with Qt enabled (VS2010) | Done | 2012-08-09 |
Associated revisions
Applied fix from bug #2324: ocv_list_unique makes for incorrect linking
Merge pull request #2324 from vpisarev:fix_facedetect
History
Updated by Mourad Boufarguine over 12 years ago
Any update on this issue? This is a grave bug affecting the 2.4.2 version of OpenCV, I hope it get fixed soon.
Updated by Andrey Kamaev over 12 years ago
- Target version deleted ()
- Assignee changed from Alexander Shishkov to Andrey Kamaev
Updated by Andrey Kamaev over 12 years ago
Thanks, fix is applied in master.
- Status changed from Open to Done
Updated by Andrey Kamaev about 12 years ago
- Target version set to 2.4.3