Changes between Version 3 and Version 4 of CMakeConfigAndBuild


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

Do tutorial with $BOOST/src and $BOOST/build to make clear we're not talking about an environment variable BOOST_ROOT. Also lots of tweaks.

Legend:

Unmodified
Added
Removed
Modified
  • CMakeConfigAndBuild

    v3 v4  
    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   1. [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 assume that the Boost source tree, with CMake build files, is available in the directory `$BOOST_ROOT`.
     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`:
     5    {{{
     6$BOOST/
     7  src/     # (source checked out to here)
     8  build/   # (build output here)
     9}}}
    510
    6   2. 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].
     11  Note that it is '''not''' actually necessary to set any environment variable `BOOST`.
     12 
     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  {{{
     15mkdir $BOOST
     16svn co http://svn.boost.org/svn/boost/sandbox-branches/boost-cmake/boost_1_34_0 $BOOST/src
     17  }}}
    718
    8   3. 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.
    9        a. '''On Windows''': Run CMake by selecting it from the Start menu.
    10             i. Use the `Browse...` button to point CMake at the Boost source code in `$BOOST_ROOT`.
    11             i. Use the second `Browse...` button to select the directory where Boost will build binaries.
    12             i. 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.
    13             i. Click "Configure" to configure Boost, which will search for various libraries on your system and prepare the build.
    14             i. 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".
    15             i. When you are done, click "OK" to generate project files.
    16        b. '''On Unix''':
    17             i. Create a new directory that will hold the binaries that CMake builds. This document will assume you have created used the directory name `boost-bin` for these binaries, and that this directory is not inside $BOOST_ROOT:
    18             {{{
    19 mkdir boost-bin
    20             }}}
    21             i. Change into the binary directory you have just created:
    22             {{{
    23 cd boost-bin
    24             }}}
    25             i. Run the CMake configuration program, providing it with the Boost source directory:
    26             {{{
    27 ccmake $BOOST_ROOT
    28             }}}
    29             i. Press `c` (for (c)onfigure) to perform the preliminary configuration of the CMake build system.
    30             i. If you want, you can edit various options in the CMake interface. These options will affect what libraries are built and how. Each time you finish editing options, press `c` to reconfigure. '''Mac OS X users''': to build universal binaries, change the value of `CMAKE_OSX_ARCHITECTURES` to `ppc;i386` in the CMake configuration.
    31             i. When the options you have selected have stabilized, CMake will give you the (g)enerate option. If you do not see this option, press `c` again to reconfigure. Finally, press `g` to generate makefiles and exit.
     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.
     21      * Use the `Browse...` button to point CMake at the Boost source code in `$BOOST\src`.
     22      * Use the second `Browse...` button to select the directory where Boost will build binaries, `$BOOST\build`.
     23      * 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.
     24      * 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".
     26      * 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      {{{
     30mkdir $BOOST/build
     31      }}}
     32      * Change into the binary directory you have just created:
     33      {{{
     34cd $BOOST/build
     35      }}}
     36      * Run the CMake configuration program, providing it with the Boost source directory:
     37      {{{
     38cmake $BOOST/src
     39      }}}
    3240
    33     That's it! You've now configured your source tree and are ready to start building Boost.
     41  That's it! You've now configured your source tree and are ready to start building Boost.
    3442
    35   4. 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.
    36        a. '''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.
    37        a. '''On Unix''' (and when using makefile variants on Microsoft Windows): If you are on Unix, you will build Boost using standard "make" tools. Change into the binary directory we created and configured earlier, than run `make`:
     43  * 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.
     44    * '''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.
     45    * '''On Unix''' (and when using makefile variants on Microsoft Windows): If you are on Unix, you will build Boost using standard "make" tools. Change into the binary directory we created and configured earlier, than run `make`:
    3846       {{{
    3947make
    4048       }}}
    4149
    42   5. 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.
     50    * 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.
    4351
    4452== Installing Boost ==