Changes between Version 1 and Version 2 of CMakeAddingCompiledLibrary


Ignore:
Timestamp:
Jun 12, 2007, 4:30:34 AM (15 years ago)
Author:
Douglas Gregor
Comment:

More info about build variants

Legend:

Unmodified
Added
Removed
Modified
  • CMakeAddingCompiledLibrary

    v1 v2  
    100100
    101101== Build Variants ==
    102 The Boost build system defines many different [wiki:CMakeBuildFeatures build features], which describe specific properties of certain builds. For example, the `SHARED` feature indicates that we are building a shared library, while the `MULTI_THREADED` feature indicates that we are building a multi-threaded library. A specific set of features is called a ```variant```, e.g., `RELEASE` and `MULTI_THREADED` and `SHARED`.
     102The Boost build system defines many different [wiki:CMakeBuildFeatures build features], which describe specific properties of certain builds. For example, the `SHARED` feature indicates that we are building a shared library, while the `MULTI_THREADED` feature indicates that we are building a multi-threaded library. A specific set of features is called a ```variant```, e.g., `RELEASE` and `MULTI_THREADED` and `SHARED`. By default, the CMake-based build system builds several different variants of each Boost library.
    103103
     104Since some features conflict with certain libraries (a threading library cannot be `SINGLE_THREADED`!), one can pass additional flags to [wiki:CMakeAddLibrary boost_add_library] stating which features should the library cannot be built with.  For example, say that our library cannot be built as a multi-threaded library, because it uses thread-unsafe routines from the underlying C library. To disable multi-threaded variants of the library, pass the option `NOT_MULTI_THREADED`:
    104105
    105 Since some features conflict with certain libraries (a threading library cannot be `SINGLE_THREADED`!), one can pass
     106{{{
     107boost_add_library(boost_libname
     108  mysrc1.cpp mysrc2.cpp
     109  COMPILE_FLAGS "-DBUILDING_BOOST_LIBNAME=1"
     110  SHARED_COMPILE_FLAGS "-DBOOST_LIBNAME_DYN_LINK=1"
     111  DEPENDS boost_filesystem
     112  NOT_MULTI_THREADED
     113  )
     114}}}