Changes between Version 5 and Version 6 of CMakeConfigAndBuild


Ignore:
Timestamp:
Jun 12, 2007, 5:44:48 PM (15 years ago)
Author:
troy d. straszheim
Comment:

change sectioning style, add link to CMakeBuildConfiguration

Legend:

Unmodified
Added
Removed
Modified
  • CMakeConfigAndBuild

    v5 v6  
    22This page describes how to configure and build Boost with CMake. By following these instructions, you should be able to get CMake, configure a Boost build tree to your liking with CMake, and then build, install, and package Boost libraries.
    33
    4   * [http://www.cmake.org/HTML/Download.html Download CMake]: There are precompiled binaries for CMake on several different platforms. The installation of these pre-compiled binaries is mostly self-explanatory. If you need to build your own copy of CMake, please see the [http://www.cmake.org/HTML/Install.html CMake installation instructions]. In these instructions, we will do things such that the Boost source tree (with CMake build files) is available in the directory `$BOOST/src` and that the build will happen in `$BOOST/build`:
     4  == [http://www.cmake.org/HTML/Download.html Download CMake] ==
     5There are precompiled binaries for CMake on several different platforms. The installation of these pre-compiled binaries is mostly self-explanatory. If you need to build your own copy of CMake, please see the [http://www.cmake.org/HTML/Install.html CMake installation instructions]. In these instructions, we will do things such that the Boost source tree (with CMake build files) is available in the directory `$BOOST/src` and that the build will happen in `$BOOST/build`:
    56    {{{
    67$BOOST/
     
    1112  Note that it is '''not''' actually necessary to set any environment variable `BOOST`, this is a convention used in this document.
    1213 
    13   * Download Boost with CMake: At present, the CMake build system is developed externally from Boost itself. To get a copy of Boost 1.34.0 with the CMake build system, retrieve it from the [wiki:BoostSubversion  Boost Subversion repository] with the URL http://svn.boost.org/svn/boost/sandbox-branches/boost-cmake/boost_1_34_0].  So,
     14== Check out Boost-CMake ==
     15At present, the CMake build system is developed externally from Boost itself. To get a copy of Boost 1.34.0 with the CMake build system, retrieve it from the [wiki:BoostSubversion  Boost Subversion repository] with the URL http://svn.boost.org/svn/boost/sandbox-branches/boost-cmake/boost_1_34_0]. 
     16
     17On unix:
    1418  {{{
    1519mkdir $BOOST
     
    1721  }}}
    1822
    19   * Configure the Boost source tree with CMake's configuration tool. This step differs depending on whether you are using CMake's GUI on Microsoft Windows or whether you are using the command-line tools provided on Unix.
    20     * '''On Windows''': Run CMake by selecting it from the Start menu.
     23== Configure the Boost source tree ==
     24This is the makefile generation step, using `CMake`'s configuration tool. This step differs depending on whether you are using CMake's GUI on Microsoft Windows or whether you are using the command-line tools provided on Unix.
     25
     26=== On Windows ===
     27Run CMake by selecting it from the Start menu.
    2128      * Use the `Browse...` button to point CMake at the Boost source code in `$BOOST\src`.
    2229      * Use the second `Browse...` button to select the directory where Boost will build binaries, `$BOOST\build`.
    2330      * CMake will ask you what kind of project files or make files to build. If you're using Microsoft Visual Studio, select the appropriate version to generate project files. Otherwise, you can use Borland's make files, generate NMake files, etc.
    2431      * Click "Configure" to configure Boost, which will search for various libraries on your system and prepare the build.
    25       * If you want, you can edit various options in the CMake GUI. These options will affect what libraries are built and how. Each time you finish editing options, click "Configure".
     32      * If you want, you can edit various options in the CMake GUI (see also [wiki:CMakeBuildConfiguration]. These options will affect what libraries are built and how. Each time you finish editing options, click "Configure".
    2633      * When you are done, click "OK" to generate project files.
    27     * '''On Unix''':
    28       *  Create the directory that will hold the binaries that CMake builds:
    29       {{{
    30 mkdir $BOOST/build
    31       }}}
    32       * Change into the binary directory you have just created:
    33       {{{
    34 cd $BOOST/build
    35       }}}
    36       * Run the CMake configuration program, providing it with the Boost source directory:
    37       {{{
    38 cmake $BOOST/src
    39       }}}
    40       You'll see output from `cmake`.  On unix it looks like this:
    41       {{{
     34=== On Unix ===
     35Create the directory that will hold the binaries that CMake build,
     36{{{
     37mkdir $BOOST/build 
     38}}}
     39Change into the binary directory you have just created:
     40{{{
     41cd $BOOST/build 
     42}}}
     43Run the CMake configuration program, providing it with the Boost source directory:
     44{{{
     45cmake $BOOST/src 
     46}}}
     47You'll see output from `cmake`.  It looks somewhat like this:
     48{{{
    4249% cmake $BOOST/src
    4350-- Check for working C compiler: /usr/bin/gcc
     
    5259--  + crc
    5360--  + mpl
    54 --  + tr1
    55 --  + bind
    56   [snip]
     61
     62  (etc, etc)
     63
    5764--  + program_options
    5865--  + ptr_container
     
    6370}}}
    6471
    65       The directory `$BOOST/build` should now contain a bunch of generated files, including a toplevel `Makefile`, something like this:
     72      The directory `$BOOST/build` should now contain a bunch of generated files, including a top level `Makefile`, something like this:
    6673      {{{
    6774 % ls
     
    7380  That's it! You've now configured your source tree and are ready to start building Boost.
    7481
    75   * Build Boost: Like configuration, the way in which one builds Boost with CMake differs from one platform to another, depending on your platform and how you configured CMake. Either way, you'll be using the tools provided to you by your compiler or operating system vendor.
    76     * '''Microsoft Visual Studio''': If you have generated project files for Microsoft Visual Studio, you will need to start up Visual Studio to build Boost. Once Visual Studio has loaded, load the solution or project`Boost` from the Boost binary directory you set in the CMake configuration earlier. Then, just click "Build" to build all of Boost.
    77     * '''On Unix''' (and when using makefile variants on Microsoft Windows): If you are on Unix, you will build Boost using standard "make" tools. In the directory $BOOST/build (where the generated makefiles are) run `make`:
    78        {{{
     82== Build Boost ==
     83Like configuration, the way in which one builds Boost with CMake differs from one platform to another, depending on your platform and how you configured CMake. Either way, you'll be using the tools provided to you by your compiler or operating system vendor.
     84=== Microsoft Visual Studio ===
     85If you have generated project files for Microsoft Visual Studio, you will need to start up Visual Studio to build Boost. Once Visual Studio has loaded, load the solution or project`Boost` from the Boost binary directory you set in the CMake configuration earlier. Then, just click "Build" to build all of Boost.
     86=== On Unix (and when using makefile variants on Microsoft Windows) ===
     87One builds using standard "make" tools. In the directory $BOOST/build (where the generated makefiles are) run `make`:
     88{{{
    7989make
    80        }}}
     90}}}
    8191
    82     * That's it! Once the build completes (which make take a while, if you are building all of the Boost libraries), the Boost libraries will be available in the `lib` subdirectory of your binary directory, ready to be used, installed, or packaged.
     92That's it! Once the build completes (which make take a while, if you are building all of the Boost libraries), the Boost libraries will be available in the `lib` subdirectory of your binary directory, ready to be used, installed, or packaged.
    8393
    8494== Installing Boost ==