Building static GUIs on macOS - nrc-cnrc/EGSnrc GitHub Wiki
To compile standalone versions of EGSnrc Qt graphical user interfaces on macOS for a release:
- Clone a copy of EGSnrc, preferably on a fresh macOS install
- Configure EGSnrc as usual, using
HEN_HOUSE/scripts/configurewith configuration file namemacos.conf - Install homebrew with the following command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - Use homebrew to install qt4:
brew install cartr/qt4/qt
On newer OS X versions, try:brew install qt - Find out the path to the Qt installation directory:
brew info qt | grep Cellar - Define a corresponding
QTDIRenvironment variable:export QTDIR=/path/to/qt/ - Go to
$HEN_HOUSE/gui/egs_guiand issue themakecommand - Go to
$HEN_HOUSE/bin/macos/and issue the commandmacdeployqt egs_gui.appto create a portable bundle (with self-contained Qt run time libraries). - Repeat steps 7-8 for
$HEN_HOUSE/gui/egs_inprz - Go to
$HEN_HOUSE/egs++/viewand issue themakecommand - It is not possible to bundle egs_view, so extract the executable from the
$HEN_HOUSE/bin/macos/egs_view.app/Contents/MacOSdirectory - Find out the egs_view library path for the libegspp dynamic library:
otool -L egs_view - Update the egs_view library path for the libegspp library:
install_name_tool -change /whatever/path/libegspp.dylib libegspp.dylib egs_view - Put the binaries inside a directory
EGSnrc-guis-macosand zip it
Note that qmake uses its own compiler configuration, in $QTDIR/mkspecs.