Opened 10 years ago
Closed 9 years ago
#50709 closed defect (fixed)
port:opencv+qt4 uses Qt5 if both Qt4 and Qt5 are installed
| Reported by: | RJVB (René Bertin) | Owned by: | stromnov (Andrey Stromnov) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | |
| Keywords: | Cc: | mkae (Marko Käning) | |
| Port: | opencv |
Description
The venom is all in the title: installing port:opencv with a Qt4 gui isn't possible currently if Qt5 is installed. I have encountered this kind of situation in other ports: a CMake file somewhere simply prefers Qt5 over Qt4 if the former version is available. The +qt4 variant thus requires a patch to that CMake file, to force it to consider only Qt4.
Attachments (1)
Change History (7)
comment:1 Changed 10 years ago by RJVB (René Bertin)
comment:2 Changed 10 years ago by RJVB (René Bertin)
Building +qt4 when Qt5 is also installed turns out not to require many modifications:
--- /opt/local/var/macports/sources/default-ports/graphics/opencv/Portfile 2016-02-24 16:35:31.000000000 +0100
+++ /opt/local/site-ports/graphics/opencv/Portfile 2016-02-24 19:47:41.000000000 +0100
@@ -208,13 +208,13 @@
variant qt4 conflicts qt5 description {Build with Qt4 Backend support.} {
PortGroup qt4 1.0
configure.args-replace -DWITH_QT=OFF \
- -DWITH_QT=ON
+ -DWITH_QT=4
}
variant qt5 conflicts qt4 description {Build with Qt5 Backend support.} {
PortGroup qt5 1.0
configure.args-replace -DWITH_QT=OFF \
- -DWITH_QT=ON
+ -DWITH_QT=5
}
variant java description {Add Java bindings.} {
Changed 10 years ago by RJVB (René Bertin)
| Attachment: | opencv.diff added |
|---|
comment:3 Changed 10 years ago by RJVB (René Bertin)
the attached patchfile contains the above change, plus correction of an error in opencv.pc for the +qt4 variant .
comment:4 Changed 10 years ago by mf2k (Frank Schima)
| Cc: | stromnov@… removed |
|---|---|
| Owner: | changed from macports-tickets@… to stromnov@… |
comment:6 Changed 9 years ago by mkae (Marko Käning)
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
| Version: | 2.3.4 |
This should be closed, as opencv has progressed in the meantime.
Note: See
TracTickets for help on using
tickets.

In addition, I'm seeing the following error when building VLC against
port:opencv+qt5:Data like
-L/opt/local/libexec/qt5/Library/Frameworks/QtOpenGL.frameworkcomes from opencv.pc (Libs.private), and is not correct. It should be-framework /opt/local/.../QtFoo.frameworkwithout a subsequent-lQtFoo. The exact path to Qt's frameworks should be obtained from the appropriate Qt PortGroup.