Getting the Source Code

Users that need to compile their own binaries should get the source code for the latest release from the Download Page.

If you're a programmer and plan to contribute with code fixes or if you're user that wants to use the latest version and accepts the risks of doing that, then you should download the source from the Git server at https://github.com/leozide/leocad.git.

Typing this will download the latest revision to a directory called 'leocad' on your computer:

$ git clone https://github.com/leozide/leocad.git

Note: You can receive notifications of source code changes by watching the project on the Github Page.

Required Libraries

LeoCAD requires Qt 4.8 or later (including Qt5) to compile. You can download the Qt SDK for all platforms from http://qt-project.org.

Linux users may find it easier to just use their package manager instead:

$ sudo apt-get install libqt4-dev libqt4-opengl-dev zlib1g-dev

Although it's not required, you should also download and install a Parts Library, otherwise only a very small set of basic parts will be available.

Compiling

The easiest way to compile on any platform is to open 'leocad.pro' in Qt Creator and build it from there.

Linux

If you're not using Qt Creator, or if you prefer to compile from the command line you can generate a Makefile using qmake and then build and install it:

leocad$ qmake leocad.pro
leocad$ make
leocad$ make install

There are two options that can be passed to qmake to customize LeoCAD builds that distribution maintainers will be interested:

  • DISABLE_UPDATE_CHECK=1: Disables update checks at startup and removes that option from the menu. This is recommended to be set for distributions that have their own way of updating applications to avoid confusing users.
  • LDRAW_LIBRARY_PATH="path": Adds an extra path to be searched at startup for the LDraw library. The path should be the root folder of the LDraw library, for example: "/usr/share/ldraw".

Windows

Windows users also have the option to compile with Visual Studio, you just need to use qmake to generate the project files first:

C:\leocad> qmake -tp vc

This will generate a file called 'leocad.vcxproj' that can be opened in Visual Studio.

macOS

To compile for macOS you'll need to add a Parts Library to the folder where you downloaded the source code. You can download the Linux library and unzip it there:

leocad$ unzip Library-Linux-7931.zip

iOS

To compile for iOS you'll need to add a Parts Library to the folder where you downloaded the source code. You can download the Linux library and unzip it there:

leocad$ unzip Library-Linux-7931.zip

Generate an Xcode project using qmake for iOS:

leocad$ ~/Qt5.8.0/5.8/ios/bin/qmake

Now open the project in Xcode and build it. A (free) Apple developer account is required to install the app on a device.