@@ -10,15 +10,20 @@ kept to a minimum to provide high performance operation.
1010 * Official Git Mirror: https://github.com/apache/serf/
1111 * Issues: https://issues.apache.org/jira/browse/SERF
1212 * Mail: dev@serf.apache.org
13- * People: Justin Erenkrantz, Greg Stein
13+ * People: Justin Erenkrantz, Greg Stein
1414
1515----
1616
17171. INSTALL
1818
19- 1.1. SCons build system
19+ 1.1 Build systems
2020
21- Apache Serf uses SCons 2.3 for its build system. If it is not installed
21+ Apache Serf can use either SCons or CMake. Both build systems should offer
22+ the same features.
23+
24+ 1.1.1 SCons build system
25+
26+ You must use at least SCons version 2.3. If it is not installed
2227on your system, then you can install it onto your system. If you do not
2328have permissions, then you can download and install the "local"
2429version into your home directory. When installed privately, simply
@@ -28,7 +33,7 @@ Fetch the scons-local package:
2833 http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz
2934
3035
31- 1.2 Building Apache Serf
36+ 1.1. 2 Building Apache Serf using SCons
3237
3338To build serf:
3439
@@ -65,12 +70,12 @@ At any point, the current settings can be examined:
6570$ scons --help
6671
6772
68- 1.3 Running the test suite
73+ 1.1. 3 Running the test suite
6974
7075$ scons check
7176
7277
73- 1.4 Installing Apache Serf
78+ 1.1. 4 Installing Apache Serf
7479
7580$ scons install
7681
@@ -88,6 +93,76 @@ $ scons PREFIX=/usr/ LIBDIR=/usr/lib64
8893$ scons install --install-sandbox=/path/to/buildroot
8994
9095
91- 1.4 Cleaning up the build
96+ 1.1.5 Cleaning up the build
9297
9398$ scons -c
99+
100+
101+ 1.2.1 CMake build system
102+
103+
104+ Get the sources, either a release tarball or by checking out the
105+ official repository. The CMake build system currently only exists in
106+ /trunk and it will be included in the 1.4 release.
107+
108+ The process for building on Unix and Windows is the same.
109+
110+ $ cmake -B out [build options]
111+ $ cmake --build out
112+
113+ "out" in the commands above is the build directory used by CMake.
114+
115+ Build options can be added, for example:
116+
117+ $ cmake -B out -DCMAKE_INSTALL_PREFIX=/usr/local/serf -DSKIP_TESTS=ON
118+
119+ Build options can be listed using:
120+
121+ $ cmake -LH
122+
123+ Windows tricks:
124+
125+ - Modern versions of Microsoft Visual Studio provide support for
126+ CMake projects out-of-box, including intellisense, integrated
127+ options editor, test explorer, and more.
128+
129+ In order to use it for Serf, open the source directory with
130+ Visual Studio, and the configuration should start automatically.
131+ For editing the cache (options), do right-click to the CMakeLists.txt
132+ file and clicking `CMake Settings for Serf` will open the
133+ editor. After the required settings are configured, hit `F7` in
134+ order to build. For more info, check the article bellow:
135+
136+ https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio
137+
138+ - There is a useful tool for bootstrapping the dependencies,
139+ vcpkg. It provides ports for the most of Serf's dependencies,
140+ which then could be installed via a single command.
141+
142+ To start using it, download the registry from GitHub, bootstrap
143+ vcpkg, and install the dependencies:
144+
145+ $ git clone https://github.com/microsoft/vcpkg
146+ $ cd vcpkg && .\bootstrap-vcpkg.bat -disableMetrics
147+ $ .\vcpkg install apr apr-util [any other dependency]
148+
149+ After this is done, vcpkg can be integrated into CMake by passing
150+ the vcpkg toolchain to CMAKE_TOOLCHAIN_FILE option. In order to do
151+ it with Visual Studio, open the CMake cache editor as explained in
152+ the previous step, and put the following into `CMake toolchain
153+ file` field, where VCPKG_ROOT is the path to vcpkg registry:
154+
155+ <VCPKG_ROOT>/scripts/buildsystems/vcpkg.cmake
156+
157+ 1.2.1 Running the test suite
158+
159+ $ cd out
160+ $ ctest
161+ # this only seems to run part of the testsuite?
162+ $ ./test/test_all
163+ # fails due to missing certificates
164+ $ cp ../test/*.pem ../test/certs test/
165+ $ ./test/test_all
166+ # Succeeds?
167+
168+ This should be described in detail.
0 commit comments