Lines Matching +full:cmake +full:-

1 <!--
4 SPDX-License-Identifier: curl
5 -->
7 # Building with CMake
10 from source code using the CMake build tool. To build with CMake, you of
11 course first have to install CMake. The minimum required version of CMake is
13 tree. Once the correct version of CMake is installed you can follow the
16 CMake builds can be configured either from the command line, or from one of
17 CMake's GUIs.
21 A CMake configuration of curl is similar to the autotools build of curl.
24 ## Using `cmake`
29 - Build in the source tree.
31 $ cmake -B .
33 - Build in a separate directory (parallel to the curl source tree in this
36 $ cmake -B ../curl-build
38 ### Fallback for CMake before version 3.13
40 CMake before version 3.13 does not support the `-B` option. In that case,
41 you must create the build directory yourself, `cd` to it and run `cmake`
44 $ mkdir ../curl-build
45 $ cd ../curl-build
46 $ cmake ../curl
50 $ cmake .
54 You can override CMake's default by using `-G <generator-name>`. For example
55 on Windows with multiple build systems if you have MinGW-w64 then you could use
56 `-G "MinGW Makefiles"`.
57 [List of generator names](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html).
61 CMake comes with a curses based interface called `ccmake`. To run `ccmake`
62 on a curl use the instructions for the command line cmake, but substitute
63 `ccmake` for `cmake`.
69 ## Using `cmake-gui`
71 CMake also comes with a Qt based GUI called `cmake-gui`. To configure with
72 `cmake-gui`, you run `cmake-gui` and follow these steps:
78 as the source tree, but a parallel directory called curl-build or
91 $ cmake --build ../curl-build
95 The CMake build setup is primarily done to work with shared/dynamic third
97 is handled automatically by the library loader - on all modern systems.
112 ### Fallback for CMake before version 3.13
114 CMake before version 3.13 does not support the `--build` option. In that
116 corresponds to the build files that CMake generated for you. This example
117 assumes that CMake generates `Makefile`:
119 $ cd ../curl-build
124 (The test suite does not yet work with the cmake build)
130 $ cmake --install ../curl-build
132 ### Fallback for CMake before version 3.15
134 CMake before version 3.15 does not support the `--install` option. In that
136 corresponds to the build files that CMake generated for you. This example
137 assumes that CMake generates `Makefile`:
139 $ cd ../curl-build
142 # CMake build options
144 - `BUILD_CURL_EXE`: Build curl executable. Default: `ON`
145 - `BUILD_EXAMPLES`: Build libcurl examples. Default: `ON`
146 - `BUILD_LIBCURL_DOCS`: Build libcurl man pages. Default: `ON`
147 - `BUILD_MISC_DOCS`: Build misc man pages (e.g. `curl-config` and `mk-ca-bun…
148 - `BUILD_SHARED_LIBS`: Build shared libraries. Default: `ON`
149 - `BUILD_STATIC_CURL`: Build curl executable with static libcurl. Default: `OF…
150 - `BUILD_STATIC_LIBS`: Build static libraries. Default: `OFF`
151 - `BUILD_TESTING`: Build tests. Default: `ON`
152 - `CURL_DEFAULT_SSL_BACKEND`: Override default TLS backend in MultiSSL builds.
154 … `wolfssl`, `gnutls`, `mbedtls`, `openssl`, `secure-transport`, `schannel`, `bearssl`, `rustls`
155 - `CURL_ENABLE_EXPORT_TARGET`: Enable CMake export target. Default: `ON`
156 - `CURL_HIDDEN_SYMBOLS`: Hide libcurl internal symbols (=hide all symbols that a…
157 - `CURL_LIBCURL_SOVERSION`: Enable libcurl SOVERSION. Default: `ON` for supported p…
158 - `CURL_LIBCURL_VERSIONED_SYMBOLS`: Enable libcurl versioned symbols. Default: `OFF`
159 - `CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX`: Override default versioned symbol prefix. Default: `<TL…
160 - `CURL_LTO`: Enable compiler Link Time Optimizations. Default: `OFF`
161 - `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`). Defaul…
162 - `CURL_TARGET_WINDOWS_VERSION`: Minimum target Windows version as hex string.
163 - `CURL_TEST_BUNDLES`: Bundle `libtest` and `unittest` tests into single binar…
164 - `CURL_WERROR`: Turn compiler warnings into errors. Default: `OFF`
165 - `ENABLE_CURLDEBUG`: Enable TrackMemory debug feature: Default: =`ENABLE_DEB…
166 - `ENABLE_CURL_MANUAL`: Build the man page for curl and enable its `-M`/`--manu…
167 - `ENABLE_DEBUG`: Enable curl debug features (for developing curl itself)…
168 - `IMPORT_LIB_SUFFIX`: Import library suffix. Default: `_imp`
169 - `LIBCURL_OUTPUT_NAME`: Basename of the curl library. Default: `libcurl`
170 - `PICKY_COMPILER`: Enable picky compiler options. Default: `ON`
171 - `STATIC_LIB_SUFFIX`: Static library suffix. Default: (empty)
175 - `CURL_CA_BUNDLE`: Path to the CA bundle. Set `none` to disable or `auto` …
176 - `CURL_CA_EMBED`: Path to the CA bundle to embed in the curl tool. Defaul…
177 - `CURL_CA_FALLBACK`: Use built-in CA store of TLS backend. Default: `OFF`
178 - `CURL_CA_PATH`: Location of default CA path. Set `none` to disable or `…
179 - `CURL_CA_SEARCH_SAFE`: Enable safe CA bundle search (within the curl tool dire…
183 - `CURL_ENABLE_SSL`: Enable SSL support. Default: `ON`
184 - `CURL_WINDOWS_SSPI`: Enable SSPI on Windows. Default: =`CURL_USE_SCHANNEL`
185 - `ENABLE_IPV6`: Enable IPv6 support. Default: `ON`
186 - `ENABLE_THREADED_RESOLVER`: Enable threaded DNS lookup. Default: `ON` if c-ares is …
187 - `ENABLE_UNICODE`: Use the Unicode version of the Windows API functions. D…
188 - `ENABLE_UNIX_SOCKETS`: Enable Unix domain sockets support. Default: `ON`
189 - `USE_ECH`: Enable ECH support. Default: `OFF`
190 - `USE_HTTPSRR`: Enable HTTPS RR support for ECH (experimental). Default…
191 - `USE_OPENSSL_QUIC`: Use OpenSSL and nghttp3 libraries for HTTP/3 support. D…
195 - `CURL_DISABLE_ALTSVC`: Disable alt-svc support. Default: `OFF`
196 - `CURL_DISABLE_AWS`: Disable **aws-sigv4**. Default: `OFF`
197 - `CURL_DISABLE_BASIC_AUTH`: Disable Basic authentication. Default: `OFF`
198 - `CURL_DISABLE_BEARER_AUTH`: Disable Bearer authentication. Default: `OFF`
199 - `CURL_DISABLE_BINDLOCAL`: Disable local binding support. Default: `OFF`
200 - `CURL_DISABLE_CA_SEARCH`: Disable unsafe CA bundle search in PATH on Windows. Def…
201 - `CURL_DISABLE_COOKIES`: Disable cookies support. Default: `OFF`
202 - `CURL_DISABLE_DICT`: Disable DICT. Default: `OFF`
203 - `CURL_DISABLE_DIGEST_AUTH`: Disable Digest authentication. Default: `OFF`
204 - `CURL_DISABLE_DOH`: Disable DNS-over-HTTPS. Default: `OFF`
205 - `CURL_DISABLE_FILE`: Disable FILE. Default: `OFF`
206 - `CURL_DISABLE_FORM_API`: Disable **form-api**: Default: =`CURL_DISABLE_MIME`
207 - `CURL_DISABLE_FTP`: Disable FTP. Default: `OFF`
208 - `CURL_DISABLE_GETOPTIONS`: Disable `curl_easy_options` API for existing options to…
209 - `CURL_DISABLE_GOPHER`: Disable Gopher. Default: `OFF`
210 - `CURL_DISABLE_HEADERS_API`: Disable **headers-api** support. Default: `OFF`
211 - `CURL_DISABLE_HSTS`: Disable HSTS support. Default: `OFF`
212 - `CURL_DISABLE_HTTP`: Disable HTTP. Default: `OFF`
213 - `CURL_DISABLE_HTTP_AUTH`: Disable all HTTP authentication methods. Default: `OFF`
214 - `CURL_DISABLE_IMAP`: Disable IMAP. Default: `OFF`
215 - `CURL_DISABLE_INSTALL`: Disable installation targets. Default: `OFF`
216 - `CURL_DISABLE_IPFS`: Disable IPFS. Default: `OFF`
217 - `CURL_DISABLE_KERBEROS_AUTH`: Disable Kerberos authentication. Default: `OFF`
218 - `CURL_DISABLE_LDAP`: Disable LDAP. Default: `OFF`
219 - `CURL_DISABLE_LDAPS`: Disable LDAPS. Default: =`CURL_DISABLE_LDAP`
220 - `CURL_DISABLE_LIBCURL_OPTION`: Disable `--libcurl` option from the curl tool. Default:…
221 - `CURL_DISABLE_MIME`: Disable MIME support. Default: `OFF`
222 - `CURL_DISABLE_MQTT`: Disable MQTT. Default: `OFF`
223 - `CURL_DISABLE_NEGOTIATE_AUTH`: Disable negotiate authentication. Default: `OFF`
224 - `CURL_DISABLE_NETRC`: Disable netrc parser. Default: `OFF`
225 - `CURL_DISABLE_NTLM`: Disable NTLM support. Default: `OFF`
226 - `CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG`: Disable automatic loading of OpenSSL configuration. Def…
227 - `CURL_DISABLE_PARSEDATE`: Disable date parsing. Default: `OFF`
228 - `CURL_DISABLE_POP3`: Disable POP3. Default: `OFF`
229 - `CURL_DISABLE_PROGRESS_METER`: Disable built-in progress meter. Default: `OFF`
230 - `CURL_DISABLE_PROXY`: Disable proxy support. Default: `OFF`
231 - `CURL_DISABLE_RTSP`: Disable RTSP. Default: `OFF`
232 - `CURL_DISABLE_SHA512_256`: Disable SHA-512/256 hash algorithm. Default: `OFF`
233 - `CURL_DISABLE_SHUFFLE_DNS`: Disable shuffle DNS feature. Default: `OFF`
234 - `CURL_DISABLE_SMB`: Disable SMB. Default: `OFF`
235 - `CURL_DISABLE_SMTP`: Disable SMTP. Default: `OFF`
236 - `CURL_DISABLE_SOCKETPAIR`: Disable use of socketpair for curl_multi_poll. Default:…
237 - `CURL_DISABLE_SRP`: Disable TLS-SRP support. Default: `OFF`
238 - `CURL_DISABLE_TELNET`: Disable Telnet. Default: `OFF`
239 - `CURL_DISABLE_TFTP`: Disable TFTP. Default: `OFF`
240 - `CURL_DISABLE_VERBOSE_STRINGS`: Disable verbose strings. Default: `OFF`
241 - `CURL_DISABLE_WEBSOCKETS`: Disable WebSocket. Default: `OFF`
242 - `HTTP_ONLY`: Disable all protocols except HTTP (This overrides all `…
246 - `CI`: Assume running under CI if set.
247 - `CURL_BUILDINFO`: Print `buildinfo.txt` if set.
248 - `CURL_CI`: Assume running under CI if set.
250 ## CMake options
252 - `CMAKE_DEBUG_POSTFIX`: Default: `-d`
253 - `CMAKE_IMPORT_LIBRARY_SUFFIX` (see CMake)
254 - `CMAKE_INSTALL_BINDIR` (see CMake)
255 - `CMAKE_INSTALL_INCLUDEDIR` (see CMake)
256 - `CMAKE_INSTALL_LIBDIR` (see CMake)
257 - `CMAKE_INSTALL_PREFIX` (see CMake)
258 - `CMAKE_STATIC_LIBRARY_SUFFIX` (see CMake)
259 - `CMAKE_UNITY_BUILD_BATCH_SIZE`: Set the number of sources in a "unity" unit. Default: `…
260 - `CMAKE_UNITY_BUILD`: Enable "unity" (aka jumbo) builds. Default: `OFF`
262 Details via CMake
263 [variables](https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html) and
264 [install directories](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html).
268 - `CURL_BROTLI`: Use brotli. Default: `OFF`
269 - `CURL_USE_BEARSSL`: Enable BearSSL for SSL/TLS. Default: `OFF`
270 - `CURL_USE_GNUTLS`: Enable GnuTLS for SSL/TLS. Default: `OFF`
271 - `CURL_USE_GSASL`: Use libgsasl. Default: `OFF`
272 - `CURL_USE_GSSAPI`: Use GSSAPI implementation. Default: `OFF`
273 - `CURL_USE_LIBPSL`: Use libpsl. Default: `ON`
274 - `CURL_USE_LIBSSH2`: Use libssh2. Default: `ON`
275 - `CURL_USE_LIBSSH`: Use libssh. Default: `OFF`
276 - `CURL_USE_LIBUV`: Use libuv for event-based tests. Default: `OFF`
277 - `CURL_USE_MBEDTLS`: Enable mbedTLS for SSL/TLS. Default: `OFF`
278 - `CURL_USE_OPENSSL`: Enable OpenSSL for SSL/TLS. Default: `ON` if no other T…
279 - `CURL_USE_PKGCONFIG`: Enable `pkg-config` to detect dependencies. Default: `O…
280 - `CURL_USE_RUSTLS`: Enable Rustls for SSL/TLS. Default: `OFF`
281 - `CURL_USE_SCHANNEL`: Enable Windows native SSL/TLS (Schannel). Default: `OFF`
282 - `CURL_USE_SECTRANSP`: Enable Apple OS native SSL/TLS (Secure Transport). Defa…
283 - `CURL_USE_WOLFSSH`: Use wolfSSH. Default: `OFF`
284 - `CURL_USE_WOLFSSL`: Enable wolfSSL for SSL/TLS. Default: `OFF`
285 - `CURL_ZLIB`: Use zlib (`ON`, `OFF` or `AUTO`). Default: `AUTO`
286 - `CURL_ZSTD`: Use zstd. Default: `OFF`
287 - `ENABLE_ARES`: Enable c-ares support. Default: `OFF`
288 - `USE_APPLE_IDN`: Use Apple built-in IDN support. Default: `OFF`
289 - `USE_LIBIDN2`: Use libidn2 for IDN support. Default: `ON`
290 - `USE_LIBRTMP`: Enable librtmp from rtmpdump. Default: `OFF`
291 - `USE_MSH3`: Use msh3/msquic library for HTTP/3 support. Default: `O…
292 - `USE_NGHTTP2`: Use nghttp2 library. Default: `ON`
293 - `USE_NGTCP2`: Use ngtcp2 and nghttp3 libraries for HTTP/3 support. De…
294 - `USE_QUICHE`: Use quiche library for HTTP/3 support. Default: `OFF`
295 - `USE_WIN32_IDN`: Use WinIDN for IDN support. Default: `OFF`
296 - `USE_WIN32_LDAP`: Use Windows LDAP implementation. Default: `ON`
298 ## Dependency options (via CMake)
300 - `OPENSSL_ROOT_DIR`: Set this variable to the root installation of OpenSSL (…
301 - `ZLIB_INCLUDE_DIR`: The zlib include directory.
302 - `ZLIB_LIBRARY`: Path to `zlib` library.
306 - `PERL_EXECUTABLE` Perl binary used throughout the build and tests.
307 - `BEARSSL_INCLUDE_DIR`: The BearSSL include directory.
308 - `BEARSSL_LIBRARY`: Path to `bearssl` library.
309 - `BROTLI_INCLUDE_DIR`: The brotli include directory.
310 - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library.
311 - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library.
312 - `CARES_INCLUDE_DIR`: The c-ares include directory.
313 - `CARES_LIBRARY`: Path to `cares` library.
314 - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (als…
315 - `LDAP_LIBRARY`: Name or full path to `ldap` library. Default: `ldap`
316 - `LDAP_LBER_LIBRARY`: Name or full path to `lber` library. Default: `lber`
317 - `LDAP_INCLUDE_DIR`: Path to LDAP include directory.
318 - `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory.
319 - `LIBGSASL_LIBRARY`: Path to `libgsasl` library.
320 - `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory.
321 - `LIBIDN2_LIBRARY`: Path to `libidn2` library.
322 - `LIBPSL_INCLUDE_DIR`: The libpsl include directory.
323 - `LIBPSL_LIBRARY`: Path to `libpsl` library.
324 - `LIBSSH_INCLUDE_DIR`: The libssh include directory.
325 - `LIBSSH_LIBRARY`: Path to `libssh` library.
326 - `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory.
327 - `LIBSSH2_LIBRARY`: Path to `libssh2` library.
328 - `LIBUV_INCLUDE_DIR`: The libuv include directory.
329 - `LIBUV_LIBRARY`: Path to `libuv` library.
330 - `MSH3_INCLUDE_DIR`: The msh3 include directory.
331 - `MSH3_LIBRARY`: Path to `msh3` library.
332 - `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory.
333 - `MBEDTLS_LIBRARY`: Path to `mbedtls` library.
334 - `MBEDX509_LIBRARY`: Path to `mbedx509` library.
335 - `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library.
336 - `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory.
337 - `NGHTTP2_LIBRARY`: Path to `nghttp2` library.
338 - `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory.
339 - `NGHTTP3_LIBRARY`: Path to `nghttp3` library.
340 - `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory.
341 - `NGTCP2_LIBRARY`: Path to `ngtcp2` library.
342 - `NETTLE_INCLUDE_DIR`: The nettle include directory.
343 - `NETTLE_LIBRARY`: Path to `nettle` library.
344 - `QUICHE_INCLUDE_DIR`: The quiche include directory.
345 - `QUICHE_LIBRARY`: Path to `quiche` library.
346 - `RUSTLS_INCLUDE_DIR`: The Rustls include directory.
347 - `RUSTLS_LIBRARY`: Path to `rustls` library.
348 - `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory.
349 - `WOLFSSH_LIBRARY`: Path to `wolfssh` library.
350 - `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory.
351 - `WOLFSSL_LIBRARY`: Path to `wolfssl` library.
352 - `ZSTD_INCLUDE_DIR`: The zstd include directory.
353 - `ZSTD_LIBRARY`: Path to `zstd` library.
357 - `APACHECTL`: Default: `apache2ctl`
358 - `APXS`: Default: `apxs`
359 - `CADDY`: Default: `caddy`
360 - `HTTPD_NGHTTPX`: Default: `nghttpx`
361 - `HTTPD`: Default: `apache2`
362 - `TEST_NGHTTPX`: Default: `nghttpx`
363 - `VSFTPD`: Default: `vsftps`