5 \___|\___/|_| \_\_____|
7 How To Compile with CMake
10 ==========================
11 This document describes how to compile, build and install curl and libcurl
12 from source code using the CMake build tool. To build with CMake, you will
13 of course have to first install CMake. The minimum required version of
14 CMake is specifed in the file CMakeLists.txt found in the top of the curl
15 source tree. Once the correct version of CMake is installed you can follow
16 the instructions below for the platform you are building on.
18 CMake builds can be configured either from the command line, or from one
23 A command line build of Curl is similar to the autotools build of Curl. It
24 consists of the following steps after you have unpacked the source.
25 # 1st create an out of source build tree parallel to the curl source
26 # tree and change into that directory
29 # now run CMake from the build tree, giving it the path to the top of
30 # the Curl source tree. CMake will pick a compiler for you. If you
31 # want to specifiy the compile, you can set the CC environment
32 # variable prior to running CMake.
35 # currently make test and make install are not implemented
41 CMake comes with a curses based interface called ccmake. To run ccmake on
42 a curl use the instructions for the command line cmake, but substitue
43 ccmake ../curl for cmake ../curl. This will bring up a curses interface
44 with instructions on the bottom of the screen. You can press the "c" key
45 to configure the project, and the "g" key to generate the project. After
46 the project is generated, you can run make.
50 CMake also comes with a Qt based GUI called cmake-gui. To configure with
51 cmake-gui, you run cmake-gui and follow these steps:
52 1. Fill in the "Where is the source code" combo box with the path to
54 2. Fill in the "Where to build the binaries" combo box with the path
55 to the directory for your build tree, ideally this should not be the
56 same as the source tree, but a parallel diretory called curl-build or
58 3. Once the source and binary directories are specified, press the
60 4. Select the native build tool that you want to use.
61 5. At this point you can change any of the options presented in the
62 GUI. Once you have selected all the options you want, click the
64 6. Run the native build tool that you used CMake to genratate.