Guides/Compiling Jqt/macOS

From J Wiki
Jump to: navigation, search
Windows | macOS | Linux

Compiling Jqt on macOS

These instructions apply to J901. As on other platforms, you may want to compile your own version of Jqt to add functions, restrict the set of required libraries, or use a newer version of Qt. A more common reason for macOS is that you want to run Jqt on a version of macOS that is not supported by the current Jqt release. Unlike Windows and Linux, the version of the Qt libraries is closely tied to a particular set of versions of macOS. The current release was built using Qt 5.12 libraries and will run on macOS versions 10.12 and later. If you want to run Jqt on macOS 10.10 (Yosemite), for example, you will have to build your own Jqt binaries.

Released versions of Jqt are compiled using LTS (Long Term Support) versions of the Qt sdk. The macOS versions supported by recent LTS versions of the Qt sdk are indicated in the table below.

Qt LTS sdk macOS versions
4.8 10.6-10.7
5.6 10.8-10.11
5.9 10.10-10.12
5.12 10.12-10.14 (10.15)

The Jqt source code will compile and run properly on all of the environments in the above table. However, only 64-bit operating systems are supported by J901. You may also use other versions of the sdk as long as they are compatible with the macOS version you are running. For example, we'll use Qt 5.14.1 on macOS 10.15 (Catalina), the most recent versions of each, in the instructions below.

Install Xcode

You need a working installation of Xcode and the associated Command Line Tools to compile Jqt. The App Store only provides the most recent version of Xcode, which may not be appropriate for your macOS version. You can find the proper release of Xcode at the following site: Xcode Releases . The download links on that site will take you to Apple Developer . You will need a (free) account on that site to download Xcode. Use the following link to search for the correct version of Xcode and the command line tools: Downloads . Download and install Xcode and the associated Command Line Tools. In the case of macOS 10.15, you can simply install the version of Xcode available in the App Store.

Install the Qt Software Development Kit (SDK)

Choose the appropriate Qt sdk for your version of macOS based on the table above and download the offline installer diskimage from Qt downloads . Choose the latest minor version in the subdirectory related to the Qt version you need. Run the installer in the diskimage and you should now have a folder in your home directory with a name like "Qt5.14.1".

Set up source directory

Set up the source directory (e.g., ~/src) and create an environment script, env.command, in it with the contents below.

export QMAKESPEC=macx-clang
export PATH=/Users/drinkwater/Qt5.14.1/5.14.1/clang_64/bin:$PATH

Change the contents of the path above to match your system.

To build the slim version, add the line


Download latest qtide source

Obtain the latest Jqt source from the Git repository. Place a copy of the source folder (e.g., qtide) in the src folder. You can modify the contents of the file qtide/lib/ to selectively remove Jqt functions as needed (how to do so will become obvious from reading the file).

Compile Jqt

To compile Jqt, open a terminal window and change to the src directory and execute the following, waiting for each command to finish before entering the next:

. ./env.command
cd qtide/lib
cd ../main

The compiled binaries are in the folder ~/src/qtide/bin/mac-/release/. Open that folder, right-click on the jqt app bundle, and choose Show Package Contents. Navigate to Contents/MacOS and copy the jqt executable to the release folder.

Install J901

Download the latest from the jsoftware web site. Unzip the folder and place it in your home directory. Open jconsole, run ./macos-fix.command, and execute the following:


Copy the files in the Jqt release folder (except for the jqt app bundle) to the bin directory of the J901 install folder. Create a Qt folder within the J901 install folder and open a terminal in the Qt folder. Execute the following to create symbolic links to the Qt sdk binaries (change the path as appropriate):

ln -s /Users/drinkwater/Qt5.14.1/5.14.1/clang_64/lib Frameworks
ln -s /Users/drinkwater/Qt5.14.1/5.14.1/clang_64/plugins plugins

Double-clicking on the Jqt icon in the J901 install folder will now start jqt.