Main  /  Edit  /  History  /   /  Users Area

How to build CppCMS 1.x.x

Requirements

In order to build CppCMS you need:

Mandatory Requirements

Recommended Dependencies

Suggested

Dependencies for Common Linux Distributions

Debian Based (Debian, Ubuntu):

Packages: cmake libpcre3-dev zlib1g-dev libgcrypt11-dev libicu-dev python

Getting:

aptitude install cmake libpcre3-dev zlib1g-dev libgcrypt11-dev libicu-dev python

RPM Based (RadHat, CentOS, Fedora, Suse):

Packages: cmake gcc-c++ gcc make zlib-devel pcre-devel libicu-devel libgcrypt-devel

Getting:

yum install cmake gcc-c++ gcc make zlib-devel pcre-devel libicu-devel libgcrypt-devel

Notes for Microsoft Visual C++ users

Building cppcms with Visual Studio projects is not supported due to complexity of debug and release mode.

You should use nmake as shown in the example.

Getting The Sources

Download the latest cppcms-1.x.x.tar.bz2 from sourceforge and extract it:

tar -xjf cppcms-1.0.4.tar.bz2

If you want to get latest version You need git to get the sources:

git clone https://github.com/artyom-beilis/cppcms.git cppcms  

Build Process

Go to the cppcms directory you created and create build directory and go to it:

mkdir build
cd build

Now configure the library with CMake

cmake ..

Or

cmake various_build_options ..

Then run

make
make test
sudo make install

Build Options

Generic Size Optimization Options for Embedded Builds:

Generic useful CMake options:

Examples

POSIX Operating Systems

I assume that you are in a terminal in the build directory inside the CppCMS source directory.

Build under Linux, FreeBSD and Cygwin:

cmake ..
make
make test 
make install

Build under OpenSolaris with SunStudio

cmake -DCMAKE_C_COMPILER=/usr/bin/suncc -DCMAKE_CXX_COMPILER=/usr/bin/sunCC ..
make
make test 
make install

Build under OpenSolaris with GCC, where ICU installed in /opt/icu

cmake -DCMAKE_INCLUDE_PATH=/opt/icu/include -DCMAKE_LIBRARY_PATH=/opt/icu/lib ..
make
make test 
make install

Microsoft Windows

We assume that 3rd part libraries installed in c:\3rd_part and sources are placed in d:\projects\cppcms

Note: You need to setup correct PATH variables in order to let system find all DLLs it needs.

Under cmd.exe:

set PATH=c:\3rd_part\lib;%PATH%
set PATH=d:\projects\cppcms\build\booster;%PATH% 

Under bash:

export PATH=/c/3rd_part/lib:"$PATH"
export PATH=/d/projects/cppcms/build/booster:"$PATH"

MinGW Builds:

For mingw builds you also need to pass a path to the mingw's library directory, otherwise it may not find winsock library correctly. Assuming you have mingw installed in c:\mingw

Open MinGW Shell terminal

cmake -G "MSYS Makefiles" -DCMAKE_INCLUDE_PATH=c:/3rd_part/include -DCMAKE_LIBRARY_PATH="c:/3rd_part/lib;c:/mingw/lib" -DCMAKE_INSTALL_PREFIX=c:/mingw ..
make
make test 
make install

MSVC Builds:

Note: You can find a full tutorial regarding MSVC build there

Open MSVC Shell terminal (All Programs > Microsoft Visual Studio 2008 > Visual Studio Tools > Visual Studio 2008 Command Prompt)

cmake -G "NMake Makefiles" -DCMAKE_INCLUDE_PATH=c:/3rd_part/include -DCMAKE_LIBRARY_PATH=c:/3rd_part/lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=c:/cppcms ..
nmake
nmake test 
nmake install

Cross Compiling

The build is just ordinary CMake cross-compilation procedure. For more information read http://www.cmake.org/Wiki/CMake_Cross_Compiling

We would provide an example for ARM under Linux, without ICU.

Create ToolChain.cmake

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER  /usr/bin/arm-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++)
SET(CMAKE_FIND_ROOT_PATH  /usr/arm-linux-gnueabi)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Configure

cmake -DCMAKE_TOOLCHAIN_FILE=ToolChain.cmake -DDISABLE_ICU_LOCALIZATION=ON  -DCMAKE_ISTALL_PREFIX=/usr/arm-linux-eabi ..
make
make install

CppCMS versioning scheme | Top | Migration to new version

About

CppCMS is a web development framework for performance demanding applications.

Support This Project

SourceForge.net Logo

Поддержать проект

CppCMS needs You


Navigation

Main Page



Valid CSS | Valid XHTML 1.0