In order to build CppCMS you need:
gcrypt or OpenSSL library -- for support of encrypted session cookies.
If both available gcrypt would be used.
Debian Based (Debian, Ubuntu):
Packages: cmake libpcre3-dev zlib1g-dev libgcrypt11-dev libicu-dev python
Getting:
RPM Based (RadHat, CentOS, Fedora, Suse):
Packages: cmake gcc-c++ gcc make zlib-devel pcre-devel libicu-devel libgcrypt-devel
Getting:
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.
Download the latest cppcms-1.x.x.tar.bz2 from sourceforge and extract it:
If you want to get latest version You need git to get the sources:
Go to the cppcms directory you created and create build directory and go to it:
Now configure the library with CMake
Or
Then run
-DDISABLE_STATIC=ON
-- disable building of static version of cppcms library-DDISABLE_SHARED=ON
-- disable building of shared version of cppcms library-DDISABLE_ICONV=ON
-- disable usage of iconv (ICU would be used instead)-DDISABLE_GCRYPT=ON
-- disable usage of gcrypt library.-DDISABLE_OPENSSL=ON
-- disable usage of OpenSSL.-DUSE_WINDOWS6_API=ON
-- use Windows Vista, Windows 7 API if possible, allows CppCMS using native Windows Vista/7 conditional variables and other advanced API. By default disabled.-DLIBDIR=lib64
- use alternative name for library directory, for example use lib64 on Red Hat based distributions.Generic Size Optimization Options for Embedded Builds:
-DDISABLE_FCGI=ON
-- build without FastCGI Server API.-DDISABLE_SCGI=ON
-- build without SCGI Server API.-DDISABLE_HTTP=ON
-- build without internal HTTP server.-DDISABLE_ICU_LOCALE=ON
-- do not use ICU for localization but rather C++ std::locale
, Windows API or POSIX API based localization -- many localization features would not be available, but it may be useful for embedded builds.-DDISABLE_PREFORK_CACHE=ON
- disable cache support for preforking modes (process shared cache)-DDISABLE_TCPCACHE=ON
- disable distributed cache support (memcached-like solution support)-DDISABLE_CACHE=ON
- disable caching system at all.-DDISABLE_GZIP=ON
- disable output gzip compression support (eliminates dependency on zlib)Generic useful CMake options:
-DCMAKE_BUILD_TYPE=(Debug|Release|RelWithDebInfo|MinSizeRel)
-- release type. RelWithDebInfo is default, unless using MSVC where Debug is default.
-DCMAKE_INCLUDE_PATH=/path/to/include
-- path to location of libraries headers, provide it in order to find libraries headers installed in non-standard locations. You almost always need to provide it under Windows.
-DCMAKE_LIBRARY_PATH=/path/to/lib
-- path to location of libraries, provide it in order to find libraries installed in non-standard locations. You almost always need to provide it under Windows.-DCMAKE_INSTALL_PREFIX=/usr/local
-- Installation prefix (similar to autoconf --prefix). Defaults to /usr/localI assume that you are in a terminal in the build directory inside the CppCMS source directory.
Build under Linux, FreeBSD and Cygwin:
Build under OpenSolaris with SunStudio
Build under OpenSolaris with GCC, where ICU installed in /opt/icu
We assume that 3rd part libraries installed in c:\3rd_part
and sources are placed ind:\projects\cppcms
Note: You need to setup correct PATH variables in order to let system find all DLLs it needs.
Under cmd.exe:
Under bash:
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
MSVC Builds:
Open MSVC Shell terminal (All Programs > Microsoft Visual Studio 2008 > Visual Studio Tools > Visual Studio 2008 Command Prompt)
The build is just ordinary CMake cross-compilation procedure. For more information readhttp://www.cmake.org/Wiki/CMake_Cross_Compiling
We would provide an example for ARM under Linux, without ICU.
Create ToolChain.cmake
Configure