How to build CppCMS 1.x.x
How to build CppCMS 1.x.x
Requirements
In order to build CppCMS you need:
Mandatory Requirements
- Modern C++ Compiler -- GCC, MSVC 9, Intel. See supported compilers and platforms
- CMake 2.6 and above, 2.8.x is recommended.
- Zlib library
- PCRE library.
- Python >=2.4 (but not 3)
Recommended Dependencies
- ICU Library 3.6 and above -- support of advanced localization features.
gcrypt or OpenSSL library -- for support of encrypted session cookies.
If both available gcrypt would be used.
Suggested
- iconv library (if libc does not provide iconv interface)
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
- make install
Build Options
-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/local
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 ind:\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:
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 readhttp://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
How to build CppCMS 1.x.x的更多相关文章
- CppCMS1.0.3 Build by VS2012
1.CppCMS简介 CppCMS是一个C++的Web开发框架(不是一个CMS).它不同于大多数其他Web开发框架,如巨蟒Django , Java的Servlets ,或C++ Wt因为它在设计和调 ...
- CPPCMS库在Windows下的使用
标题:CPPCMS库在Windows下的使用时间:2012-7作者:Kagula 环境:[1]WinXP SP3[2]VisualStudio2008 SP1[3]ZLib 1.2.7[4]PCRE ...
- 解决 Springboot Unable to build Hibernate SessionFactory @Column命名不起作用
问题: Springboot启动报错: Caused by: org.springframework.beans.factory.BeanCreationException: Error creati ...
- [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform
eclipse maven clean install 报错 1. 修改properties-->resource-->utf-8仍然报错 2.修改项目pom.xml文件,增加: < ...
- 解决 Could not find com.android.tools.build:gradle 问题
今天拉同事最新的代码,编译时老是报如下错误: Error:Could not find com.android.tools.build:gradle:2.2.0.Searched in the fol ...
- 搭建TFS 2015 Build Agent环境(一)
Download the build agent Downloading the build agent is really simple. Navigate to your TFS control ...
- Go build constraints
Go语言有一个不(奇)错(葩)的设计,就是build constraints(构建约束).可以在源码中通过注释的方式指定编译选项,比如只允许在linux下,或者在386的平台上编译啊之类的:还可以通过 ...
- [异常解决] How to build a gcc toolchain for nRF51 on linux (very detailed!!!)
1.Install gcc-arm-none-eabi https://devzone.nordicsemi.com/tutorials/7/This link shows that developm ...
- Microsoft Build 2016 Day 2 记录(多图慎入)
Microsoft Build 2016 Day 1 记录 Microsoft Build 2016 进行到了第二天,我觉得这一天的内容非常精彩,因为主要和开发者相关
随机推荐
- jdbc 使用谨记
jdbc是java操作数据库的杀手锏.所有java程序员,对jdbc应该都不陌生. 但是,应该你也曾经被其折磨的抓耳挠腮,咬牙切齿吧,也许正因为这样你才对其记忆犹新,刻骨铭心. 这里有一些使用jdbc ...
- dotnetnuke 7.x登录时不跳到站点设置中的指定页
查源码发现登录按钮有参数,点击跳到登录页或者弹窗登录,真正登录后会根据传参的url反回.因为皮肤对像没有相应参数,所以只能去掉参数.我是用js去的,偷个懒吧.如下所示: <script type ...
- illumina测序原理
一些常用基本概念的介绍: flowcell流动池 是指Illumina测序时,测序反应发生的位置,1个flowcell含有8条lane lane通道 每一个flowcell上都有8条泳道,用于测序反应 ...
- AcDbTable 类
Table 例子学习笔记在这个例子中,ARX向我们展示了ACDBTABLE类的一些基本操作方法,ACDBTABLE类是ACAD2005及其以后的产品,应该是说ACDBDATATABLE的升级产品,Ac ...
- CentOS下使用yum安装配置和使用svn
安装说明 系统环境:CentOS-6.3安装方式:yum install (源码安装容易产生版本兼容的问题)安装软件:系统自动下载SVN软件 检查已安装版本 ? 1 2 3 4 5 6 7 8 9 1 ...
- LOJ 6145 Easy (动态点分治+线段树)
题目传送门 先建出来点分树,以每个点为根开线段树,维护点分子树内编号为$[l,r]$的儿子到根的距离最小值 每次查询$x$开始,沿着点分树向上跑,在每个点的线段树的$[l,r]$区间里都查一遍取$mi ...
- Flask - 内置Session
目录 Flask - 内置Session 基本用法 给视图添加装饰器验证 Flask - 内置Session Flask中的Session非常的奇怪,他会将你的SessionID存放在客户端的Cook ...
- c发邮件
/* base64编码 */ static const char* base64_enc_map = \ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmno ...
- linux学习1-基础知识
1.输入一行字跳到行头 ctrl+a:跳到行尾 ctrl+e: 2.一次创建多个文件 touch love_{1..10}_linux.txt touch love_{1,3,5}_linux.txt ...
- 【codeforces 508A】Pasha and Pixels
[题目链接]:http://codeforces.com/contest/508/problem/A [题意] 让你在一个n*m的方格上给方格染色; 顺序给出染色的k个格子 如果在某一时刻 有一个2* ...