Difference between revisions of "Build from source"

From LibreCAD wiki
Jump to: navigation, search
m (Building LibreCAD 2.0 on Windows)
(added howto for installer building)
Line 8: Line 8:
  
 
Download Qt from : [http://qt-project.org/downloads]. Qt-5.0.1 for Windows 32 bit (MinGW 4.7) is used as an example in this article.
 
Download Qt from : [http://qt-project.org/downloads]. Qt-5.0.1 for Windows 32 bit (MinGW 4.7) is used as an example in this article.
Install Qt (including Qt-Creator) to \Qt\Qt5.0.1\ (Assuming you install everything to C:\ , the same assumption thereafter), and the MinGW tools are at: \Qt\Qt5.0.1\Tools\MinGW\bin\
+
 
 +
Install Qt (including Qt-Creator) to \Qt\Qt5.0.1\ (Assuming you install everything to C:\ , the same assumption thereafter)
 +
 
 +
Install the MinGW tools are at: \Qt\Qt5.0.1\Tools\MinGW\bin\
  
 
=== boost ===
 
=== boost ===
Introduction for boost can be found here [http://www.boost.org/doc/libs/1_53_0/more/getting_started/windows.html].
+
 
Download boost from: [http://www.boost.org/users/download/].
+
Introduction for boost can be found here [http://www.boost.org/doc/libs/1_53_0/more/getting_started/windows.html boost introduction].
unzip the boost files to the directory: \boost\ , and for the version boost-1.53.0, the boost files will be located in \boost\boost_1_53_0\ . Verify that you have the file \boost\boost_1_53_0\booststrap.bat. You don't have build boost in order to build LibreCAD, as LibreCAD uses header only part of boost currently.
+
 
 +
Download boost from: [http://www.boost.org/users/download/ boost download].
 +
 
 +
unzip the boost files to the directory: \boost\ , and for the version boost-1.53.0, the boost files will be located in \boost\boost_1_53_0\ .
 +
 
 +
Verify that you have the file \boost\boost_1_53_0\booststrap.bat. You don't have build boost in order to build LibreCAD, as LibreCAD uses header only part of boost currently.
 +
 
 
within the LibreCAD source folder, edit the '''settings_windows.pro''' file accordingly,
 
within the LibreCAD source folder, edit the '''settings_windows.pro''' file accordingly,
  
Line 20: Line 29:
  
 
=== muParser ===
 
=== muParser ===
muParser is at [http://muparser.beltoforion.de/].
+
 
Download muParser source from: [http://sourceforge.net/projects/muparser/files/muparser/]
+
muParser is at [http://muparser.beltoforion.de/ muParser].
 +
 
 +
Download muParser source from: [http://sourceforge.net/projects/muparser/files/muparser/ muParser Download]
 +
 
 
unzip the muParser source files to \muparser\muparser_v2_2_3 (for muParser-2.2.3).
 
unzip the muParser source files to \muparser\muparser_v2_2_3 (for muParser-2.2.3).
  
Line 40: Line 52:
  
 
=== Building LibreCAD in Qt-Creator ===
 
=== Building LibreCAD in Qt-Creator ===
 +
 
Launch Qt-Creator and open the '''librecad.pro''' project file within the LibreCAD source folder. Accept Qt path detected by Qt-Creator by clicking "Configure Project" button, if the project is not configured yet.
 
Launch Qt-Creator and open the '''librecad.pro''' project file within the LibreCAD source folder. Accept Qt path detected by Qt-Creator by clicking "Configure Project" button, if the project is not configured yet.
  
 
If everything is good up to this point, you can build and run LibreCAD within Qt-Creator.
 
If everything is good up to this point, you can build and run LibreCAD within Qt-Creator.
 +
 +
=== Building Windows by command line ===
 +
 +
A command line building script file is added as scripts/build-windows.bat
 +
To be able to use this batch file, you need to have your Qt directories set up first. In the file scripts/build-windows.bat, Qt_Dir is set:
 +
 +
    set Qt_DIR=C:\Qt\Qt5.0.2\5.0.2
 +
 +
and if you point Qt_DIR to the folder where you have installed your Qt to. You should have the Qt/MinGW tools at:
 +
 +
    %Qt_DIR%\mingw47_32\bin\qmake.exe
 +
    %Qt_DIR%\..\Tools\MinGW\bin\mingw32-make.exe
 +
 +
To start building, go to the scripts/ folder within the LibreCAD source folder from Windows command prompt
 +
 +
    cd scripts
 +
 +
run the build-windows.bat
 +
 +
    build-windows.bat
 +
 +
 +
=== Building Windows Installer by NSIS ===
 +
 +
If you would like to build an installer for Windows, you will need the tool [http://nsis.sourceforge.net/Main_Page NSIS].
 +
 +
You need to setup Qt_Dir and Qt_Version in the scripts\postprocess-windowsnsis-5.0.nsi file.
 +
 +
 +
    !define Qt_Dir "C:\Qt"
 +
    !define Qt_Version "5.0.2"
 +
 +
These settings indicate Qt-5.0.2 is installed at C:\Qt\Qt5.0.2\5.0.2\ and it comes with Qt-Creator at C:\Qt\Qt5.0.2\Tools\QtCreator\
 +
 +
To start building of windows installer, start windows command prompt, go to the scripts/ folder within LibreCAD source folder, and run the batch file build-windows.bat as in the previous section.
 +
 +
If everything runs smoothly, you should have the installer file as,
 +
 +
    scripts\postprocess-windows\LibreCAD-installer.exe

Revision as of 03:47, 2 June 2013

Building LibreCAD 2.0 on Windows

To build LibreCAD from the lastest development version, you will need tools: git , Qt, boost, and muParser.

The ways to get LibreCAD source code in Windows are described at [1].

Qt

Download Qt from : [2]. Qt-5.0.1 for Windows 32 bit (MinGW 4.7) is used as an example in this article.

Install Qt (including Qt-Creator) to \Qt\Qt5.0.1\ (Assuming you install everything to C:\ , the same assumption thereafter)

Install the MinGW tools are at: \Qt\Qt5.0.1\Tools\MinGW\bin\

boost

Introduction for boost can be found here boost introduction.

Download boost from: boost download.

unzip the boost files to the directory: \boost\ , and for the version boost-1.53.0, the boost files will be located in \boost\boost_1_53_0\ .

Verify that you have the file \boost\boost_1_53_0\booststrap.bat. You don't have build boost in order to build LibreCAD, as LibreCAD uses header only part of boost currently.

within the LibreCAD source folder, edit the settings_windows.pro file accordingly,

   BOOST_DIR = /boost/boost_1_53_0/
   BOOST_LIBDIR = /boost/boost_1_53_0/

muParser

muParser is at muParser.

Download muParser source from: muParser Download

unzip the muParser source files to \muparser\muparser_v2_2_3 (for muParser-2.2.3).

Steps to build muParser with MinGW:

run DOS prompt as Administrator (Start->All Programs->Accessories->Command Prompt , right click and choose "Run as administrator") in DOS prompt, type in:

   set PATH=C:\Qt\Qt5.0.1\Tools\MinGW\bin;%PATH%
   cd \muparser\muparser_v2_2_3\build
   C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe -f makefile.mingw

muParser should build smoothly.

within the LibreCAD source folder, edit the settings_windows.pro file accordingly,

   MUPARSER_DIR = /muparser/muparser_v2_2_3

Building LibreCAD in Qt-Creator

Launch Qt-Creator and open the librecad.pro project file within the LibreCAD source folder. Accept Qt path detected by Qt-Creator by clicking "Configure Project" button, if the project is not configured yet.

If everything is good up to this point, you can build and run LibreCAD within Qt-Creator.

Building Windows by command line

A command line building script file is added as scripts/build-windows.bat To be able to use this batch file, you need to have your Qt directories set up first. In the file scripts/build-windows.bat, Qt_Dir is set:

   set Qt_DIR=C:\Qt\Qt5.0.2\5.0.2

and if you point Qt_DIR to the folder where you have installed your Qt to. You should have the Qt/MinGW tools at:

   %Qt_DIR%\mingw47_32\bin\qmake.exe
   %Qt_DIR%\..\Tools\MinGW\bin\mingw32-make.exe

To start building, go to the scripts/ folder within the LibreCAD source folder from Windows command prompt

   cd scripts

run the build-windows.bat

   build-windows.bat


Building Windows Installer by NSIS

If you would like to build an installer for Windows, you will need the tool NSIS.

You need to setup Qt_Dir and Qt_Version in the scripts\postprocess-windowsnsis-5.0.nsi file.


   !define Qt_Dir "C:\Qt"
   !define Qt_Version "5.0.2"

These settings indicate Qt-5.0.2 is installed at C:\Qt\Qt5.0.2\5.0.2\ and it comes with Qt-Creator at C:\Qt\Qt5.0.2\Tools\QtCreator\

To start building of windows installer, start windows command prompt, go to the scripts/ folder within LibreCAD source folder, and run the batch file build-windows.bat as in the previous section.

If everything runs smoothly, you should have the installer file as,

   scripts\postprocess-windows\LibreCAD-installer.exe