You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

INSTALL.cmake 3.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. - Does not support all SSL libraries (only OpenSSL, WinSSL, DarwinSSL, and
  22. mbed TLS)
  23. - Doesn't build with SCP and SFTP support (libssh2) (see issue #1155)
  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 find or use krb4 or GSS
  30. - Rebuilds test files too eagerly, but still can't run the tests
  31. - Does't detect the correct strerror_r flavor when cross-compiling (issue #1123)
  32. Command Line CMake
  33. ==================
  34. A CMake build of curl is similar to the autotools build of curl. It
  35. consists of the following steps after you have unpacked the source.
  36. 1. Create an out of source build tree parallel to the curl source
  37. tree and change into that directory
  38. $ mkdir curl-build
  39. $ cd curl-build
  40. 2. Run CMake from the build tree, giving it the path to the top of
  41. the curl source tree. CMake will pick a compiler for you. If you
  42. want to specify the compile, you can set the CC environment
  43. variable prior to running CMake.
  44. $ cmake ../curl
  45. $ make
  46. 3. Install to default location:
  47. $ make install
  48. (The test suite does not work with the cmake build)
  49. ccmake
  50. =========
  51. CMake comes with a curses based interface called ccmake. To run ccmake on
  52. a curl use the instructions for the command line cmake, but substitute
  53. ccmake ../curl for cmake ../curl. This will bring up a curses interface
  54. with instructions on the bottom of the screen. You can press the "c" key
  55. to configure the project, and the "g" key to generate the project. After
  56. the project is generated, you can run make.
  57. cmake-gui
  58. =========
  59. CMake also comes with a Qt based GUI called cmake-gui. To configure with
  60. cmake-gui, you run cmake-gui and follow these steps:
  61. 1. Fill in the "Where is the source code" combo box with the path to
  62. the curl source tree.
  63. 2. Fill in the "Where to build the binaries" combo box with the path
  64. to the directory for your build tree, ideally this should not be the
  65. same as the source tree, but a parallel directory called curl-build or
  66. something similar.
  67. 3. Once the source and binary directories are specified, press the
  68. "Configure" button.
  69. 4. Select the native build tool that you want to use.
  70. 5. At this point you can change any of the options presented in the
  71. GUI. Once you have selected all the options you want, click the
  72. "Generate" button.
  73. 6. Run the native build tool that you used CMake to generate.