Skip to content

Latest commit

 

History

History
126 lines (94 loc) · 3.5 KB

BUILD.md

File metadata and controls

126 lines (94 loc) · 3.5 KB

Build QttpServer 1.0.0 beta with gyp

Getting started on Mac & Linux

Prerequisites

  1. git

  2. python 2.x

  3. qt installer or build from source

    # Building from source is a breeze - works well for Ubuntu 12 & 14 LTS
    sudo apt-get install libssl-dev
    wget http://download.qt.io/official_releases/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.gz
    tar -xvf qt-everywhere-opensource-src-5.5.1.tar.tz
    cd qt-everywhere-opensource-src-5.5.1
    ./configure -nomake examples -opensource -skip qtwebkit -skip qtwebchannel -skip qtquick1 -skip qtdeclarative -openssl-linked
    make
    sudo make install
  4. perl

Build

git clone https://github.com/supamii/QttpServer.git
cd QttpServer

Git submodules/dependencies automatically pulls in mongodb-drivers, boost, libuv, http-parser

git submodule update --init

Generate build files and compile to ./build/out/ folder

./build.py
make -C build/out

Generate and build or launch qttp.pro with Qt Creator

qmake CONFIG+=debug qttp.pro
make

If you want to run a quick sample application:

qmake CONFIG+=debug CONFIG+=SAMPLEAPP qttp.pro
make
./qttpserver

If you want to compile a static library:

qmake CONFIG+=debug CONFIG+=QTTP_LIBRARY qttp.pro

If you want to compile a shared library:

qmake CONFIG+=debug CONFIG+=QTTP_LIBRARY CONFIG+=QTTP_EXPORT qttp.pro

Optional components

Build Redis client

Pretty straight forward stuff here - just be mindful of the extra environment variable set to DESTDIR:

cd lib/qredisclient
git submodule update --init
qmake CONFIG+=debug DESTDIR=. qredisclient.pro
make

Getting started with MSVC 2015 (Windows 8 & 10)

The MSVC 2012 and 2013 compilers don't support C++1y well enough so QttpServer is limited to Windows 8+ with Visual Studio 2015.

Using prebuilt installers for Qt 5.6+ is recommended but there is also an older guide for Qt 5.5 here.

The following guide below was developed and tested using Windows 10.

Prerequisites

  1. Visual Studio 2015 community (MSVC 2015 tool-chain)
  2. Qt 5.6+
  3. git
  4. python 2.x
  5. strawberry perl - As a precaution

Building QttpServer on Windows

git clone https://github.com/supamii/QttpServer
cd QttpServer

Git submodules/dependencies automatically pulls in mongodb-drivers, boost, libuv, http-parser

git submodule update --init

Use Python to generate build files and compile to ./build/out folder

build.py

Open solution build/all.sln with VS2015 - or execute from the developer console

cd build
msbuild.exe all.sln /p:Configuration=Debug

Launch qttp.pro in QtCreator and build.

As a side note, if you want to run a quick sample application you can add CONFIG+=SAMPLEAPP to the additional arguments section located in QtCreator under Projects > Build & Run > Build Steps > qmake > Additional arguments

Building DLLs will require additional parameters into qmake: CONFIG+=QTTP_LIBRARY CONFIG+=QTTP_EXPORT

If you want to compile a static library:

qmake CONFIG+=debug CONFIG+=QTTP_LIBRARY qttp.pro