1339230SpeterExperimental cmake-based build support for APR-Util on Microsoft Windows
2339230Speter
3339230SpeterStatus
4339230Speter------
5339230Speter
6339230SpeterThis build support is currently intended only for Microsoft Windows.
7339230SpeterOnly Windows NT-based systems can be targeted.  (The traditional 
8339230SpeterWindows build support for APR can target Windows 9x as well.)
9339230Speter
10339230SpeterThis build support is experimental.  Specifically,
11339230Speter
12339230Speter* It does not support all features of APR-Util.
13339230Speter* Some components may not be built correctly and/or in a manner
14339230Speter  compatible with the previous Windows build support.
15339230Speter* Build interfaces, such as the mechanisms which are used to enable
16339230Speter  optional functionality or specify prerequisites, may change from
17339230Speter  release to release as feedback is received from users and bugs and
18339230Speter  limitations are resolved.
19339230Speter
20339230SpeterImportant: Refer to the "Known Bugs and Limitations" section for further
21339230Speter           information.
22339230Speter
23339230Speter           It is beyond the scope of this document to document or explain
24339230Speter           how to utilize the various cmake features, such as different
25339230Speter           build backends or provisions for finding support libraries.
26339230Speter
27339230Speter           Please refer to the cmake documentation for additional information
28339230Speter           that applies to building any project with cmake.
29339230Speter
30339230SpeterPrerequisites
31339230Speter-------------
32339230Speter
33339230SpeterThe following tools must be in PATH:
34339230Speter
35339230Speter* cmake, version 2.8 or later
36339230Speter  cmake version 3.1.3 or later is required to work with current OpenSSL
37339230Speter  releases.  (OpenSSL is an optional prerequisite of APR-Util.)
38339230Speter* If using a command-line compiler: compiler and linker and related tools
39339230Speter  (Refer to the cmake documentation for more information.)
40339230Speter
41339230SpeterThe following support libraries are mandatory:
42339230Speter
43339230Speter* APR 1.4.x or APR 1.5.x, built with cmake
44339230Speter
45339230SpeterOptional support libraries allow optional features of APR to be enabled:
46339230Speter
47339230Speter* OpenSSL
48339230Speter* many others potentially, though the build support isn't currently
49339230Speter  implemented
50339230Speter
51339230SpeterHow to build
52339230Speter------------
53339230Speter
54339230Speter1. cd to a clean directory for building (i.e., don't build in your
55339230Speter   source tree)
56339230Speter
57339230Speter2. Some cmake backends may want your compile tools in PATH.  (Hint: "Visual
58339230Speter   Studio Command Prompt")
59339230Speter
60339230Speter3. set CMAKE_LIBRARY_PATH=d:\path\to\prereq1\lib;d:\path\to\prereq2\lib;...
61339230Speter
62339230Speter4. set CMAKE_INCLUDE_PATH=d:\path\to\prereq1\include;d:\path\to\prereq2\include;...
63339230Speter
64339230Speter5. cmake -G "some backend, like 'NMake Makefiles'"
65339230Speter     -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst
66339230Speter     -DAPR-Util-specific-flags
67339230Speter     d:/path/to/aprutilsource
68339230Speter
69339230Speter   If APR 1.x was installed to a different directory than APR-Util,
70339230Speter   also pass these additional arguments:
71339230Speter
72339230Speter     -DAPR_INCLUDE_DIR=d:/path/to/apr1inst/include
73339230Speter     -DAPR_LIBRARIES=d:/path/to/apr1inst/lib/libapr-1.lib
74339230Speter
75339230Speter   Alternately, use cmake-gui and update settings in the GUI.
76339230Speter
77339230Speter   APR-Util feature flags:
78339230Speter
79339230Speter       APU_HAVE_CRYPTO        Build crypt support (only the OpenSSL
80339230Speter                              implementation is currently supported)
81339230Speter                              Default: OFF
82339230Speter       APU_HAVE_ODBC          Build ODBC DBD driver
83339230Speter                              Default: ON
84339230Speter       APR_BUILD_TESTAPR      Build APR-Util test suite
85339230Speter                              Default: OFF
86339230Speter       TEST_STATIC_LIBS       Build the test suite to test the APR static
87339230Speter                              library instead of the APR dynamic library.
88339230Speter                              Default: OFF
89339230Speter                              In order to build the test suite against both
90339230Speter                              static and dynamic libraries, separate builds
91339230Speter                              will be required, one with TEST_STATIC_LIBS
92339230Speter                              set to ON.
93339230Speter       INSTALL_PDB            Install .pdb files if generated.
94339230Speter                              Default: ON
95339230Speter
96339230Speter   CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL
97339230Speter
98339230Speter   CMAKE_BUILD_TYPE
99339230Speter
100339230Speter       For NMake Makefiles the choices are at least DEBUG, RELEASE,
101339230Speter       RELWITHDEBINFO, and MINSIZEREL
102339230Speter       Other backends make have other selections.
103339230Speter
104339230Speter6. build using chosen backend (e.g., "nmake install")
105339230Speter
106339230SpeterKnown Bugs and Limitations
107339230Speter--------------------------
108339230Speter
109339230Speter* If include/apu.h or other generated files have been created in the source
110339230Speter  directory by another build system, they will be used unexpectedly and
111339230Speter  cause the build to fail.
112339230Speter* Options should be provided for remaining features, along with finding any
113339230Speter  necessary libraries
114339230Speter  + DBM:
115339230Speter    . APU_HAVE_GDBM
116339230Speter    . APU_HAVE_NDBM
117339230Speter    . APU_HAVE_DB
118339230Speter  + DBD:
119339230Speter    . APU_HAVE_PGSQL
120339230Speter    . APU_HAVE_MYSQL
121339230Speter    . APU_HAVE_SQLITE3
122339230Speter    . APU_HAVE_SQLITE2
123339230Speter    . APU_HAVE_ORACLE
124339230Speter  + CRYPTO:
125339230Speter    . APU_HAVE_NSS
126339230Speter  + XLATE, APU_HAVE_ICONV (no way to consume an apr-iconv build yet)
127339230Speter* Static builds of APR modules are not supported.
128339230Speter* CHANGES/LICENSE/NOTICE is not installed, unlike Makefile.win.
129339230Speter  (But unlike Makefile.win we want to call them APR-Util-CHANGES.txt
130339230Speter  and so on.)  But perhaps that is a job for a higher-level script.
131339230Speter
132339230SpeterGenerally:
133339230Speter
134339230Speter* Many APR-Util features have not been tested with this build.
135339230Speter* Developers need to examine the existing Windows build in great detail and see
136339230Speter  what is missing from the cmake-based build, whether a feature or some build
137339230Speter  nuance.
138339230Speter* Any feedback you can provide on your experiences with this build will be
139339230Speter  helpful.
140