Initial import.
[profile/ivi/apr-util.git] / README.cmake
1 Experimental cmake-based build support for APR-Util on Microsoft Windows
2
3 Status
4 ------
5
6 This build support is currently intended only for Microsoft Windows.
7
8 This build support is experimental.  Specifically,
9
10 * It does not support all features of APR-Util.
11 * Some components may not be built correctly and/or in a manner
12   compatible with the previous Windows build support.
13 * Build interfaces, such as the mechanisms which are used to enable
14   optional functionality or specify prerequisites, may change from
15   release to release as feedback is received from users and bugs and
16   limitations are resolved.
17
18 Important: Refer to the "Known Bugs and Limitations" section for further
19            information.
20
21            It is beyond the scope of this document to document or explain
22            how to utilize the various cmake features, such as different
23            build backends or provisions for finding support libraries.
24
25            Please refer to the cmake documentation for additional information
26            that applies to building any project with cmake.
27
28 Prerequisites
29 -------------
30
31 The following tools must be in PATH:
32
33 * cmake, version 2.8 or later
34 * If using a command-line compiler: compiler and linker and related tools
35   (Refer to the cmake documentation for more information.)
36
37 The following support libraries are mandatory:
38
39 * APR 1.4.x, built with cmake
40
41 Optional support libraries allow optional features of APR to be enabled:
42
43 * OpenSSL
44 * many others potentially, though the build support isn't currently
45   implemented
46
47 How to build
48 ------------
49
50 1. cd to a clean directory for building (i.e., don't build in your
51    source tree)
52
53 2. Some cmake backends may want your compile tools in PATH.  (Hint: "Visual
54    Studio Command Prompt")
55
56 3. set CMAKE_LIBRARY_PATH=d:\path\to\prereq1\lib;d:\path\to\prereq2\lib;...
57
58 4. set CMAKE_INCLUDE_PATH=d:\path\to\prereq1\include;d:\path\to\prereq2\include;...
59
60 5. cmake -G "some backend, like 'NMake Makefiles'"
61      -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst
62      -DAPR-Util-specific-flags
63      d:/path/to/aprutilsource
64
65    If APR 1.x was installed to a different directory than APR-Util,
66    also pass these additional arguments:
67
68      -DAPR_INCLUDE_DIR=d:/path/to/apr1inst/include
69      -DAPR_LIBRARIES=d:/path/to/apr1inst/lib/libapr-1.lib
70
71    Alternately, use cmake-gui and update settings in the GUI.
72
73    APR-Util feature flags:
74
75        APU_HAVE_CRYPTO        Build crypt support (only the OpenSSL
76                               implementation is currently supported)
77                               Default: OFF
78        APU_HAVE_ODBC          Build ODBC DBD driver
79                               Default: ON
80        APR_BUILD_TESTAPR      Build APR-Util test suite
81                               Default: OFF
82        TEST_STATIC_LIBS       Build the test suite to test the APR static
83                               library instead of the APR dynamic library.
84                               Default: OFF
85                               In order to build the test suite against both
86                               static and dynamic libraries, separate builds
87                               will be required, one with TEST_STATIC_LIBS
88                               set to ON.
89        INSTALL_PDB            Install .pdb files if generated.
90                               Default: ON
91
92    CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL
93
94    CMAKE_BUILD_TYPE
95
96        For NMake Makefiles the choices are at least DEBUG, RELEASE,
97        RELWITHDEBINFO, and MINSIZEREL
98        Other backends make have other selections.
99
100 6. build using chosen backend (e.g., "nmake install")
101
102 Known Bugs and Limitations
103 --------------------------
104
105 * If include/apu.h or other generated files have been created in the source
106   directory by another build system, they will be used unexpectedly and
107   cause the build to fail.
108 * Options should be provided for remaining features, along with finding any
109   necessary libraries
110   + DBM:
111     . APU_HAVE_GDBM
112     . APU_HAVE_NDBM
113     . APU_HAVE_DB
114   + DBD:
115     . APU_HAVE_PGSQL
116     . APU_HAVE_MYSQL
117     . APU_HAVE_SQLITE3
118     . APU_HAVE_SQLITE2
119     . APU_HAVE_ORACLE
120   + CRYPTO:
121     . APU_HAVE_NSS
122   + XLATE, APU_HAVE_ICONV (no way to consume an apr-iconv build yet)
123 * Static builds of APR modules are not supported.
124 * CHANGES/LICENSE/NOTICE is not installed, unlike Makefile.win.
125   (But unlike Makefile.win we want to call them APR-Util-CHANGES.txt
126   and so on.)  But perhaps that is a job for a higher-level script.
127
128 Generally:
129
130 * Many APR-Util features have not been tested with this build.
131 * Developers need to examine the existing Windows build in great detail and see
132   what is missing from the cmake-based build, whether a feature or some build
133   nuance.
134 * Any feedback you can provide on your experiences with this build will be
135   helpful.