INSTALL.cmake 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. _ _ ____ _
  2. ___| | | | _ \| |
  3. / __| | | | |_) | |
  4. | (__| |_| | _ <| |___
  5. \___|\___/|_| \_\_____|
  6. How To Compile with CMake
  7. Building with CMake
  8. ==========================
  9. This document describes how to compile, build and install curl and libcurl
  10. from source code using the CMake build tool. To build with CMake, you will
  11. of course have to first install CMake. The minimum required version of
  12. CMake is specified in the file CMakeLists.txt found in the top of the curl
  13. source tree. Once the correct version of CMake is installed you can follow
  14. the instructions below for the platform you are building on.
  15. CMake builds can be configured either from the command line, or from one
  16. of CMake's GUI's.
  17. Current flaws in the curl CMake build
  18. =====================================
  19. Missing features in the cmake build:
  20. - Builds libcurl without large file support
  21. - It doesn't build src/tool_hugehelp.c which creates the --manual output
  22. - Can't select which SSL library to build with, only OpenSSL
  23. - Doesn't build with SCP and SFTP support (libssh2)
  24. - Doesn't allow different resolver backends (no c-ares build support)
  25. - No RTMP support built
  26. - Doesn't allow build curl and libcurl debug enabled
  27. - Doesn't allow a custom CA bundle path
  28. - Doesn't allow you to disable specific protocols from the build
  29. - Doesn't properly enable IPv6 support by default
  30. - Doesn't find or use krb4 or GSS
  31. - Rebuilds test files too eagerly, but still can't run the tests
  32. Important notice
  33. ==================
  34. If you got your curl sources from a distribution tarball, make sure to
  35. delete the generic 'include/curl/curlbuild.h' file that comes with it:
  36. rm -f curl/include/curl/curlbuild.h
  37. The purpose of this file is to provide reasonable definitions for systems
  38. where autoconfiguration is not available. CMake will create its own
  39. version of this file in its build directory. If the "generic" version
  40. is not deleted, weird build errors may occur on some systems.
  41. Command Line CMake
  42. ==================
  43. A CMake build of curl is similar to the autotools build of curl. It
  44. consists of the following steps after you have unpacked the source.
  45. 1. Create an out of source build tree parallel to the curl source
  46. tree and change into that directory
  47. $ mkdir curl-build
  48. $ cd curl-build
  49. 2. Run CMake from the build tree, giving it the path to the top of
  50. the curl source tree. CMake will pick a compiler for you. If you
  51. want to specify the compile, you can set the CC environment
  52. variable prior to running CMake.
  53. $ cmake ../curl
  54. $ make
  55. 3. Install to default location:
  56. $ make install
  57. (The teste suit does not work with the cmake build)
  58. ccmake
  59. =========
  60. CMake comes with a curses based interface called ccmake. To run ccmake on
  61. a curl use the instructions for the command line cmake, but substitute
  62. ccmake ../curl for cmake ../curl. This will bring up a curses interface
  63. with instructions on the bottom of the screen. You can press the "c" key
  64. to configure the project, and the "g" key to generate the project. After
  65. the project is generated, you can run make.
  66. cmake-gui
  67. =========
  68. CMake also comes with a Qt based GUI called cmake-gui. To configure with
  69. cmake-gui, you run cmake-gui and follow these steps:
  70. 1. Fill in the "Where is the source code" combo box with the path to
  71. the curl source tree.
  72. 2. Fill in the "Where to build the binaries" combo box with the path
  73. to the directory for your build tree, ideally this should not be the
  74. same as the source tree, but a parallel directory called curl-build or
  75. something similar.
  76. 3. Once the source and binary directories are specified, press the
  77. "Configure" button.
  78. 4. Select the native build tool that you want to use.
  79. 5. At this point you can change any of the options presented in the
  80. GUI. Once you have selected all the options you want, click the
  81. "Generate" button.
  82. 6. Run the native build tool that you used CMake to generate.