jhu-cisst / cisst

JHU ERC CISST Library
http://github.com/jhu-cisst/cisst/wiki
Other
61 stars 46 forks source link

Finding Qt5 on OS X with homebrew #27

Open ahundt opened 9 years ago

ahundt commented 9 years ago

I don't need this at the moment but wanted to record the issue.

I have Qt5 installed on OS X using homebrew, but the cmake configuration script failed to find it.

 Looking for Qt5: can't find Qt5Core
 Looking for Qt5: can't find Qt5Widgets
 Looking for Qt5: can't find Qt5Gui
 Looking for Qt5: can't find Qt5OpenGL
brew info Qt5
Qt5: stable 5.4.2 (bottled), HEAD
Version 5 of the Qt framework
https://www.qt.io/

This formula is keg-only.
Qt 5 conflicts Qt 4 (which is currently much more widely used).

/usr/local/Cellar/Qt5/5.4.1 (6392 files, 289M)
  Poured from bottle
/usr/local/Cellar/Qt5/5.4.2 (6319 files, 287M)
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/qt5.rb
==> Dependencies
Build: xz ✔, pkg-config ✔
Optional: d-bus ✔
==> Options
--universal
    Build a universal binary
--with-d-bus
    Build with d-bus support
--with-developer
    Build and link with developer options
--with-docs
    Build documentation
--with-examples
    Build examples
--with-mysql
    Build with mysql support
--with-oci
    Build with Oracle OCI plugin
--HEAD
    Install HEAD version
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

This formula is keg-only, which means it was not symlinked into /usr/local.

Qt 5 conflicts Qt 4 (which is currently much more widely used).

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/Qt5/lib
    CPPFLAGS: -I/usr/local/opt/Qt5/include

.app bundles were installed.
Run `brew linkapps Qt5` to symlink these to /Applications.
``

all the folders seem to be correctly present in the standard `/usr/local/include` location:

ls /usr/local/include/Qt QtCore@ QtHelp@ QtScript@ QtTest@ QtXmlPatterns@ QtDeclarative@ QtMultimedia@ QtScriptTools@ QtUiTools@ QtDesigner@ QtNetwork@ QtSql@ QtWebKit@ QtGui@ QtOpenGL@ QtSvg@ QtXml@

bvagvol1 commented 9 years ago

Note: Qt5 seems to be found automatically if installed via MacPorts.

However, it seems like Qt5 is a required dependency now, as I haven’t succeeded to generate the cisst project without installing it first. I had Qt4 installed but that was irrelevant, as CMake didn’t let me generate unless I had Qt5. This happened on two different computers (both OS X with Xcode) in the past week using up-to-date cisst source.

The solution was to remove Qt4 and install Qt5, but that’s not a desirable behavior. Cisst should be able to compile without any Qt available.

Balazs

On Jul 20, 2015, at 3:15 PM, Andrew Hundt notifications@github.com wrote:

I don't need this at the moment but wanted to recored the issue.

I have Qt5 installed on OS X using homebrew, but the cmake configuration script failed to find it.

Looking for Qt5: can't find Qt5Core Looking for Qt5: can't find Qt5Widgets Looking for Qt5: can't find Qt5Gui Looking for Qt5: can't find Qt5OpenGL brew info Qt5 Qt5: stable 5.4.2 (bottled), HEAD Version 5 of the Qt framework https://www.qt.io/

This formula is keg-only. Qt 5 conflicts Qt 4 (which is currently much more widely used).

/usr/local/Cellar/Qt5/5.4.1 (6392 files, 289M) Poured from bottle /usr/local/Cellar/Qt5/5.4.2 (6319 files, 287M) Poured from bottle From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/qt5.rb ==> Dependencies Build: xz ✔, pkg-config ✔ Optional: d-bus ✔ ==> Options --universal Build a universal binary --with-d-bus Build with d-bus support --with-developer Build and link with developer options --with-docs Build documentation --with-examples Build examples --with-mysql Build with mysql support --with-oci Build with Oracle OCI plugin --HEAD Install HEAD version ==> Caveats We agreed to the Qt opensource license for you. If this is unacceptable you should uninstall.

This formula is keg-only, which means it was not symlinked into /usr/local.

Qt 5 conflicts Qt 4 (which is currently much more widely used).

Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables:

LDFLAGS:  -L/usr/local/opt/Qt5/lib
CPPFLAGS: -I/usr/local/opt/Qt5/include

.app bundles were installed. Run brew linkapps Qt5 to symlink these to /Applications. ``

all the folders seem to be correctly present in the standard /usr/local/include location: ls /usr/local/include/Qt QtCore@ QtHelp@ QtScript@ QtTest@ QtXmlPatterns@ QtDeclarative@ QtMultimedia@ QtScriptTools@ QtUiTools@ QtDesigner@ QtNetwork@ QtSql@ QtWebKit@ QtGui@ QtOpenGL@ QtSvg@ QtXml@

— Reply to this email directly or view it on GitHub https://github.com/jhu-cisst/cisst/issues/27.

marcinbalicki commented 9 years ago

I just updated my MacPorts and cmake does not find qt5-mac @5.4.2_1 on OS X. I can manually point cmake to each QT module which works.
Marcin

marcinbalicki commented 9 years ago

Looks like mac ports is starting to install qt5 in a different directory so that it does not conflict with qt4:

http://stackoverflow.com/questions/31315354/qt5-and-macports-missing-links

Marcin

bvagvol1 commented 9 years ago

When I wanted to install Qt5, it returned with an error saying that Qt4 needs to be uninstalled before installing Qt5.

On Jul 22, 2015, at 12:33 PM, Marcin Balicki notifications@github.com wrote:

Looks like mac ports is starting to install qt5 in a different directory so that it does not conflict with qt4:

http://stackoverflow.com/questions/31315354/qt5-and-macports-missing-links

Marcin

— Reply to this email directly or view it on GitHub.

pratheeksh commented 7 years ago

How do we use qtlua with Sierra? I can't find an easy way to install Qt4 on Sierra.

ericalingyuan commented 7 years ago

@pratheeksh me neither. spend two days. just try to figure out how to install qtlua on mac, qtlua require qt4.x, but cannot install qt4.x on current mac

ahundt commented 7 years ago

qt4 is end of life with no support. It is not recommended you use it. That said, the following should install it from https://github.com/osrf/homebrew-simulation:

brew tap osrf/simulation
brew install qt4-no-webkit

as for qtlua perhaps ask them? https://github.com/torch/qtlua

or maybe use luarocks? https://luarocks.org/