2009-06-06 17:18:01 +04:00
|
|
|
_ _ ____ _
|
|
|
|
___| | | | _ \| |
|
|
|
|
/ __| | | | |_) | |
|
|
|
|
| (__| |_| | _ <| |___
|
|
|
|
\___|\___/|_| \_\_____|
|
|
|
|
|
|
|
|
How To Compile with CMake
|
|
|
|
|
|
|
|
Building with CMake
|
|
|
|
==========================
|
|
|
|
This document describes how to compile, build and install curl and libcurl
|
|
|
|
from source code using the CMake build tool. To build with CMake, you will
|
|
|
|
of course have to first install CMake. The minimum required version of
|
2012-07-20 23:02:58 +04:00
|
|
|
CMake is specified in the file CMakeLists.txt found in the top of the curl
|
2009-06-06 17:18:01 +04:00
|
|
|
source tree. Once the correct version of CMake is installed you can follow
|
|
|
|
the instructions below for the platform you are building on.
|
2010-02-14 22:40:18 +03:00
|
|
|
|
2009-06-06 17:18:01 +04:00
|
|
|
CMake builds can be configured either from the command line, or from one
|
2010-02-14 22:40:18 +03:00
|
|
|
of CMake's GUI's.
|
2009-06-06 17:18:01 +04:00
|
|
|
|
2012-08-23 12:53:08 +04:00
|
|
|
Current flaws in the curl CMake build
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
Missing features in the cmake build:
|
|
|
|
|
|
|
|
- Builds libcurl without large file support
|
2017-02-21 03:33:53 +03:00
|
|
|
- Does not support all SSL libraries (only OpenSSL, WinSSL, DarwinSSL, and
|
|
|
|
mbed TLS)
|
2017-04-06 09:04:12 +03:00
|
|
|
- Doesn't build with SCP and SFTP support (libssh2) (see issue #1155)
|
2012-08-23 12:53:08 +04:00
|
|
|
- Doesn't allow different resolver backends (no c-ares build support)
|
|
|
|
- No RTMP support built
|
|
|
|
- Doesn't allow build curl and libcurl debug enabled
|
|
|
|
- Doesn't allow a custom CA bundle path
|
|
|
|
- Doesn't allow you to disable specific protocols from the build
|
|
|
|
- Doesn't find or use krb4 or GSS
|
|
|
|
- Rebuilds test files too eagerly, but still can't run the tests
|
2017-04-06 09:04:12 +03:00
|
|
|
- Does't detect the correct strerror_r flavor when cross-compiling (issue #1123)
|
2012-08-23 12:53:08 +04:00
|
|
|
|
|
|
|
|
2009-06-06 17:18:01 +04:00
|
|
|
Command Line CMake
|
|
|
|
==================
|
2012-08-23 12:53:08 +04:00
|
|
|
A CMake build of curl is similar to the autotools build of curl. It
|
2009-06-06 17:18:01 +04:00
|
|
|
consists of the following steps after you have unpacked the source.
|
2012-08-23 12:53:08 +04:00
|
|
|
|
|
|
|
1. Create an out of source build tree parallel to the curl source
|
|
|
|
tree and change into that directory
|
|
|
|
|
|
|
|
$ mkdir curl-build
|
|
|
|
$ cd curl-build
|
|
|
|
|
|
|
|
2. Run CMake from the build tree, giving it the path to the top of
|
|
|
|
the curl source tree. CMake will pick a compiler for you. If you
|
|
|
|
want to specify the compile, you can set the CC environment
|
|
|
|
variable prior to running CMake.
|
|
|
|
|
|
|
|
$ cmake ../curl
|
|
|
|
$ make
|
|
|
|
|
|
|
|
3. Install to default location:
|
|
|
|
|
|
|
|
$ make install
|
|
|
|
|
2014-03-13 07:48:38 +04:00
|
|
|
(The test suite does not work with the cmake build)
|
2009-06-06 17:18:01 +04:00
|
|
|
|
|
|
|
ccmake
|
|
|
|
=========
|
|
|
|
CMake comes with a curses based interface called ccmake. To run ccmake on
|
2012-07-20 23:02:58 +04:00
|
|
|
a curl use the instructions for the command line cmake, but substitute
|
2009-06-06 17:18:01 +04:00
|
|
|
ccmake ../curl for cmake ../curl. This will bring up a curses interface
|
|
|
|
with instructions on the bottom of the screen. You can press the "c" key
|
|
|
|
to configure the project, and the "g" key to generate the project. After
|
|
|
|
the project is generated, you can run make.
|
|
|
|
|
|
|
|
cmake-gui
|
|
|
|
=========
|
|
|
|
CMake also comes with a Qt based GUI called cmake-gui. To configure with
|
|
|
|
cmake-gui, you run cmake-gui and follow these steps:
|
|
|
|
1. Fill in the "Where is the source code" combo box with the path to
|
|
|
|
the curl source tree.
|
|
|
|
2. Fill in the "Where to build the binaries" combo box with the path
|
|
|
|
to the directory for your build tree, ideally this should not be the
|
2012-07-20 23:02:58 +04:00
|
|
|
same as the source tree, but a parallel directory called curl-build or
|
2010-02-14 22:40:18 +03:00
|
|
|
something similar.
|
2009-06-06 17:18:01 +04:00
|
|
|
3. Once the source and binary directories are specified, press the
|
|
|
|
"Configure" button.
|
2010-02-14 22:40:18 +03:00
|
|
|
4. Select the native build tool that you want to use.
|
2009-06-06 17:18:01 +04:00
|
|
|
5. At this point you can change any of the options presented in the
|
|
|
|
GUI. Once you have selected all the options you want, click the
|
2010-02-14 22:40:18 +03:00
|
|
|
"Generate" button.
|
2012-07-20 23:02:58 +04:00
|
|
|
6. Run the native build tool that you used CMake to generate.
|
2010-02-14 22:40:18 +03:00
|
|
|
|