From 10317d06974df2aca788d87814eca163b5878160 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 7 Jan 2019 17:32:31 +0100 Subject: updated build instructions --- README.md | 61 ++++++++++++++++++++++++++++--------------------------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 797b653..7b18ad5 100644 --- a/README.md +++ b/README.md @@ -5,23 +5,22 @@ TikZiT is a graphical tool for rapidly creating graphs and string diagrams using ## Building on Windows -TiKZiT can be built in Windows using Qt Creator (part of Qt for Windows) or Visual Studio with the Qt VS Tools extension. +TiKZiT can be built in Windows using Qt Creator (part of Qt for Windows) or from the command line. In either case, it is recommended you compile with mingw32, which is included in the official Qt distribution. There is no reason, in principle, that you couldn't use mingw64 or MSVC, but these haven't been tested. -To build with Qt Creator, simply click 'Open Project' and navigate to the `.pro` file in the TikZiT repo. +In addition to Qt itself, TikZiT needs flex/bison, Poppler (with Qt bindings), and OpenSSL. For flex/bison, the simplest way to install this is to download WinFlexBison, then make sure both are in your `%Path%` so the build tools can find them. Alternatively, you can install it via Chocolatey, via: -To install Qt VS Tools in Visual Studio 2017, go to `Tools > Extensions and Updates`, then click "Online" in the sidebar and search for Qt. Configure your Qt install under `Qt VS Tools > Qt Options`. If you installed Qt using the Windows package above, the path to Qt is probably something like `C:\Qt\5.XXX\msvc2017_64`. Once that is done, open the `.pro` file in the TikZiT repo via `Qt VS Tools > Open Qt Project File`. + > choco install winflexbison -The only dependency besides Qt itself is flex/bison, which is used to build the TikZ parser. The simplest way to install this is to download WinFlexBison, then make sure both are in your `%PATH%` so the build tools can find them. +For convenience, I have packaged up some headers and pre-built DLLs to take care of the Poppler and OpenSSL dependencies in a single shot. If you wish to use these, download win32-deps.zip and extract it into the source folder before building. At this point, you should be able to open `tikzit.pro` in Qt Creator and build the project. If you wish to build from the command line, make sure `mingw32-make.exe` is in your `%Path%`. For the version that comes with Qt, this is in `C:\Qt\Tools\mingw530_32\bin`. Then, from the command prompt, run: -You can alternatively build from the command line with mingw or Visual Studio, and install necessary dependencies via Chocolatey. This setup has been tested on Windows 10 with Visual Studio 2015 and Qt 5.11.1. After installing Qt 5.11 and Visual Studio, run the following commands in a `cmd` prompt: + > C:\Qt\5.XX.X\mingw53_32\bin\qtenv2.bat + > cd \path\to\tikzit + > qmake -r + > mingw32-make - - choco install winflexbison - C:\Qt\5.11.1\msvc2015_64\bin\qtenv2.bat - call "C:\ProgramFiles (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 - cd C:\path\to\tikzit - qmake - nmake +To get a portable directory, you can then (optionally) run: + + > deploy-win.bat @@ -29,48 +28,44 @@ You can alternatively build from the command line with mingw or Visual Studio, a This should be buildable in Linux using a "standard" dev setup (gcc, flex, bison, make) as well as Qt. It has been tested with Qt 5.9, which is packaged with Ubuntu 18.04 (Bionic Beaver). The setup on Ubuntu is: - $ sudo apt-get install flex bison qt5-default + $ sudo apt -y install flex bison qt5-default libpoppler-dev libpoppler-qt5-dev After that, building is: - $ qmake + $ qmake -r $ make +To get a portable directory, you can then (optionally) run: + + ./deploy-linux.sh + Building on other distributions should be similar. For Qt setup, you can find instructions for openSUSE and Arch Linux on the Qt wiki. ## Building on MacOS -You'll need developer tools and Qt5 installed. The latter can be installed using e.g. Homebrew, as follows: +You'll need developer tools, Qt5, and Poppler (with Qt bindings) installed. You can install these via Homebrew with the following commands: $ brew install qt5 + $ brew install poppler --with-qt -This doesn't add Qt binaries to the PATH by default, so you may wish to add this to your shell startup script: +This doesn't add Qt binaries to the `$PATH` by default, so you may wish either run: - export PATH="/usr/local/opt/qt/bin:$PATH" + $ brew link --force qt5 -Then, TikZiT is built just like a normal Qt project: +or add `/usr/local/opt/qt/bin` to your `$PATH`. Once this is done, TikZiT can be build from the command line via: - $ qmake + $ qmake -r $ make +To bundle the required libraries into `tikzit.app` and create a `.dmg` file, you can additionally run: + + $ ./deploy-osx.sh + On older systems (pre-10.11), you can build with Qt 5.6, which claims to support Mac OS as far back as Mountain Lion. It is installable via MacPorts: $ sudo port -N -k install qt56 $ export PATH=/opt/local/libexec/qt5/bin:$PATH -Then, you should be able to run `qmake && make`, as above. - - - - -## Building Poppler with Qt bindings - -Although TikZiT doesn't currently support PDF preview, it probably will in the near future via Poppler. Here's the instructions for building it as a developer. - -Poppler should be built from source to get the Qt5 bindings. If Qt is setup correctly, the configure script included with Poppler should enable these automatically. Also, note that clang needs to have C++11 features enabled to build successfully. TikZiT has been tested on MacOS with poppler-0.50.0 (available here), built with the following commands: - - $ CXXFLAGS="-std=c++11" ./configure - $ CXXFLAGS="-std=c++11" make - +I have only tested this with TikZiT 2.0, so to install Poppler (required by TikZiT >= 2.1), you are on your own. -- cgit v1.2.3