ENH: add some cmake docs and fix build with socklen_t
[platform/upstream/curl.git] / docs / INSTALL.cmake
1                                   _   _ ____  _
2                               ___| | | |  _ \| |
3                              / __| | | | |_) | |
4                             | (__| |_| |  _ <| |___
5                              \___|\___/|_| \_\_____|
6
7                                 How To Compile with CMake
8
9 Building 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.
17   
18    CMake builds can be configured either from the command line, or from one
19    of CMake's GUI's.  
20
21 Command Line CMake
22 ==================
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
27        mkdir curl-build
28        cd curl-build
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.
33        cmake ../curl  
34        make
35        # currently make test and make install are not implemented
36        #make test
37        #make install
38
39 ccmake
40 =========
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.
47
48 cmake-gui
49 =========
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
53         the curl source tree.
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
57         something similar.  
58         3. Once the source and binary directories are specified, press the
59         "Configure" button.
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
63         "Generate" button. 
64         6. Run the native build tool that you used CMake to genratate.
65