INSTALL.cmake 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 specifed 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. Command Line CMake
  18. ==================
  19. A command line build of Curl is similar to the autotools build of Curl. It
  20. consists of the following steps after you have unpacked the source.
  21. # 1st create an out of source build tree parallel to the curl source
  22. # tree and change into that directory
  23. mkdir curl-build
  24. cd curl-build
  25. # now run CMake from the build tree, giving it the path to the top of
  26. # the Curl source tree. CMake will pick a compiler for you. If you
  27. # want to specifiy the compile, you can set the CC environment
  28. # variable prior to running CMake.
  29. cmake ../curl
  30. make
  31. # currently make test and make install are not implemented
  32. #make test
  33. #make install
  34. ccmake
  35. =========
  36. CMake comes with a curses based interface called ccmake. To run ccmake on
  37. a curl use the instructions for the command line cmake, but substitue
  38. ccmake ../curl for cmake ../curl. This will bring up a curses interface
  39. with instructions on the bottom of the screen. You can press the "c" key
  40. to configure the project, and the "g" key to generate the project. After
  41. the project is generated, you can run make.
  42. cmake-gui
  43. =========
  44. CMake also comes with a Qt based GUI called cmake-gui. To configure with
  45. cmake-gui, you run cmake-gui and follow these steps:
  46. 1. Fill in the "Where is the source code" combo box with the path to
  47. the curl source tree.
  48. 2. Fill in the "Where to build the binaries" combo box with the path
  49. to the directory for your build tree, ideally this should not be the
  50. same as the source tree, but a parallel diretory called curl-build or
  51. something similar.
  52. 3. Once the source and binary directories are specified, press the
  53. "Configure" button.
  54. 4. Select the native build tool that you want to use.
  55. 5. At this point you can change any of the options presented in the
  56. GUI. Once you have selected all the options you want, click the
  57. "Generate" button.
  58. 6. Run the native build tool that you used CMake to genratate.