Changes between Initial Version and Version 1 of CMakeConfigAndBuild


Ignore:
Timestamp:
Jun 12, 2007, 5:54:47 AM (15 years ago)
Author:
Douglas Gregor
Comment:

Configuring and building Boost, early draft

Legend:

Unmodified
Added
Removed
Modified
  • CMakeConfigAndBuild

    v1 v1  
     1= Configuring and Building Boost with CMake =
     2This 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.
     3
     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`.
     5
     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].
     7
     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 
     10       a. '''On Windows''': Run CMake by selecting it from the Start menu.
     11            i. Use the `Browse...` button to point CMake at the Boost source code in `$BOOST_ROOT`.
     12            i. Use the second `Browse...` button to select the directory where Boost will build binaries.
     13            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.
     14            i. Click "Configure" to configure Boost, which will search for various libraries on your system and prepare the build.
     15            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".
     16            i. When you are done, click "OK" to generate project files.
     17
     18       b. '''On Unix''':
     19            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:
     20            {{{
     21mkdir boost-bin
     22            }}}
     23            i. Change into the binary directory you have just created:
     24            {{{
     25cd boost-bin
     26            }}}
     27            i. Run the CMake configuration program, providing it with the Boost source directory:
     28            {{{
     29ccmake $BOOST_ROOT
     30            }}}
     31            i. Press `c` (for (c)onfigure) to perform the preliminary configuration of the CMake build system.
     32            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.
     33            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.
     34
     35    That's it! You've now configured your source tree and are ready to start building Boost.
     36
     37  4. Build Boost: Like configuration, the way in which one builds Boost with CMake differs from one platform to another, depending on