Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2007-06-08 16:44:05


Author: dgregor
Date: 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
New Revision: 4501
URL: http://svn.boost.org/trac/boost/changeset/4501

Log:
Big cleanup and renaming of CMake modules, to simplify the structure

Added:
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake
      - copied, changed from r4500, /sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostTesting.cmake
      - copied unchanged from r4500, /sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostUtils.cmake
Removed:
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/filter_out.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/list_contains.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/no_dotfile_glob.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/parse_arguments.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/sort.cmake
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/unique.cmake
Text files modified:
   sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt | 4 ++
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake | 44 ++++++++++++++++++++++-----------------
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake | 6 ++--
   3 files changed, 31 insertions(+), 23 deletions(-)

Modified: sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
@@ -40,8 +40,10 @@
 # Boost CMake modules #
 ##########################################################################
 list(APPEND CMAKE_MODULE_PATH ${Boost_SOURCE_DIR}/tools/build/CMake)
-include(boost)
+include(BoostUtils)
 include(BoostConfig)
+include(BoostCore)
+include(BoostTesting)
 ##########################################################################
 
 ##########################################################################

Modified: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostConfig.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
@@ -1,24 +1,30 @@
 ##########################################################################
-# Boost Configuration Information #
+# Boost Configuration Support #
+##########################################################################
+# Copyright (C) 2007 Douglas Gregor <doug.gregor_at_[hidden]> #
+# Copyright (C) 2007 Troy Straszheim #
+# #
+# Distributed under the Boost Software License, Version 1.0. #
+# See accompanying file LICENSE_1_0.txt or copy at #
+# http://www.boost.org/LICENSE_1_0.txt #
+##########################################################################
+# This module defines several variables that provide information about #
+# the target compiler and platform. #
+# #
+# Variables defined: #
+# #
+# BOOST_TOOLSET: #
+# The Boost toolset name, used by the library version mechanism to #
+# encode the compiler and version into the name of the #
+# library. This toolset name will correspond with Boost.Build #
+# version 2's toolset name, including version number. #
+# #
+# MULTI_THREADED_COMPILE_FLAGS: #
+# Compilation flags when building multi-threaded programs. #
+# #
+# MULTI_THREADED_LINK_FLAGS: #
+# Linker flags when building multi-threaded programs. #
 ##########################################################################
-#
-# This module defines several variables that provide information about
-# the target compiler and platform.
-#
-# Variables defined:
-#
-# BOOST_TOOLSET:
-# The Boost toolset name, used by the library version mechanism to
-# encode the compiler and version into the name of the
-# library. This toolset name will correspond with Boost.Build
-# version 2's toolset name.
-#
-# MULTI_THREADED_COMPILE_FLAGS:
-# Compilation flags when building multi-threaded programs.
-#
-# MULTI_THREADED_LINK_FLAGS:
-# Linker flags when building multi-threaded programs.
-#
 
 # Toolset detection.
 if (NOT BOOST_TOOLSET)

Copied: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake (from r4500, /sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake)
==============================================================================
--- /sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostCore.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
@@ -125,6 +125,9 @@
 macro(boost_library_variant_target_name)
   set(VARIANT_TARGET_NAME "")
 
+ # The versioned name starts with the full Boost toolset
+ set(VARIANT_VERSIONED_NAME "-${BOOST_TOOLSET}")
+
   # Add -mt for multi-threaded libraries
   list_contains(VARIANT_IS_MT MULTI_THREADED ${ARGN})
   if (VARIANT_IS_MT)
@@ -142,9 +145,6 @@
     set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-shared")
   endif (VARIANT_IS_STATIC)
 
- # The versioned name starts with the full Boost toolset
- set(VARIANT_VERSIONED_NAME "-${BOOST_TOOLSET}")
-
   # Compute the ABI tag, which depends on various kinds of options
   set(VARIANT_ABI_TAG "")
 

Added: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostUtils.cmake
==============================================================================
--- (empty file)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostUtils.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
@@ -0,0 +1,104 @@
+##########################################################################
+# Boost Utilities #
+##########################################################################
+# Copyright (C) 2007 Douglas Gregor <doug.gregor_at_[hidden]> #
+# Copyright (C) 2007 Troy Straszheim #
+# #
+# Distributed under the Boost Software License, Version 1.0. #
+# See accompanying file LICENSE_1_0.txt or copy at #
+# http://www.boost.org/LICENSE_1_0.txt #
+##########################################################################
+# Macros in this module: #
+# #
+# list_contains: Determine whether a string value is in a list. #
+# #
+# car: Return the first element in a list #
+# #
+# cdr: Return all but the first element in a list #
+# #
+# parse_arguments: Parse keyword arguments for use in other macros. #
+##########################################################################
+
+# This utility macro determines whether a particular string value
+# occurs within a list of strings:
+#
+# list_contains(result string_to_find arg1 arg2 arg3 ... argn)
+#
+# This macro sets the variable named by result equal to TRUE if
+# string_to_find is found anywhere in the following arguments.
+macro(list_contains var value)
+ set(${var})
+ foreach (value2 ${ARGN})
+ if (${value} STREQUAL ${value2})
+ set(${var} TRUE)
+ endif (${value} STREQUAL ${value2})
+ endforeach (value2)
+endmacro(list_contains)
+
+# This utility macro extracts the first argument from the list of
+# arguments given, and places it into the variable named var.
+#
+# car(var arg1 arg2 ...)
+macro(car var)
+ set(${var} ${ARGV1})
+endmacro(car)
+
+# This utility macro extracts all of the arguments given except the
+# first, and places them into the variable named var.
+#
+# car(var arg1 arg2 ...)
+macro(cdr var junk)
+ set(${var} ${ARGN})
+endmacro(cdr)
+
+# The PARSE_ARGUMENTS macro will take the arguments of another macro and
+# define several variables. The first argument to PARSE_ARGUMENTS is a
+# prefix to put on all variables it creates. The second argument is a
+# list of names, and the third argument is a list of options. Both of
+# these lists should be quoted. The rest of PARSE_ARGUMENTS are
+# arguments from another macro to be parsed.
+#
+# PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)
+#
+# For each item in options, PARSE_ARGUMENTS will create a variable with
+# that name, prefixed with prefix_. So, for example, if prefix is
+# MY_MACRO and options is OPTION1;OPTION2, then PARSE_ARGUMENTS will
+# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These
+# variables will be set to true if the option exists in the command line
+# or false otherwise.
+#
+# For each item in arg_names, PARSE_ARGUMENTS will create a variable
+# with that name, prefixed with prefix_. Each variable will be filled
+# with the arguments that occur after the given arg_name is encountered
+# up to the next arg_name or the end of the arguments. All options are
+# removed from these lists. PARSE_ARGUMENTS also creates a
+# prefix_DEFAULT_ARGS variable containing the list of all arguments up
+# to the first arg_name encountered.
+MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
+ SET(DEFAULT_ARGS)
+ FOREACH(arg_name ${arg_names})
+ SET(${prefix}_${arg_name})
+ ENDFOREACH(arg_name)
+ FOREACH(option ${option_names})
+ SET(${prefix}_${option} FALSE)
+ ENDFOREACH(option)
+
+ SET(current_arg_name DEFAULT_ARGS)
+ SET(current_arg_list)
+ FOREACH(arg ${ARGN})
+ LIST_CONTAINS(is_arg_name ${arg} ${arg_names})
+ IF (is_arg_name)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ SET(current_arg_name ${arg})
+ SET(current_arg_list)
+ ELSE (is_arg_name)
+ LIST_CONTAINS(is_option ${arg} ${option_names})
+ IF (is_option)
+ SET(${prefix}_${arg} TRUE)
+ ELSE (is_option)
+ SET(current_arg_list ${current_arg_list} ${arg})
+ ENDIF (is_option)
+ ENDIF (is_arg_name)
+ ENDFOREACH(arg)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ENDMACRO(PARSE_ARGUMENTS)

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,525 +0,0 @@
-##########################################################################
-# Core Functionality for Boost #
-##########################################################################
-# Copyright (C) 2007 Douglas Gregor <doug.gregor_at_[hidden]> #
-# Copyright (C) 2007 Troy Straszheim #
-# #
-# Distributed under the Boost Software License, Version 1.0. #
-# See accompanying file LICENSE_1_0.txt or copy at #
-# http://www.boost.org/LICENSE_1_0.txt #
-##########################################################################
-# Important developer macros in this file: #
-# #
-# boost_library_project: Defines a Boost library project (e.g., #
-# Boost.Python). #
-# #
-# boost_library: Builds library binaries for Boost libraries with #
-# compiled sources (e.g., boost_filesystem). #
-##########################################################################
-
-# Defines a Boost library project (e.g., for Boost.Python). Use as:
-#
-# boost_library_project(libname
-# [SRCDIRS srcdir1 srcdir2 ...]
-# [TESTDIRS testdir1 testdir2 ...])
-#
-# where libname is the name of the library (e.g., Python, or
-# Filesystem), srcdir1, srcdir2, etc, are subdirectories containing
-# library sources (for Boost libraries that build actual library
-# binaries), and testdir1, testdir2, etc, are subdirectories
-# containing regression tests.
-#
-# For libraries that build actual library binaries, this macro adds a
-# option BUILD_BOOST_LIBNAME (which defaults to ON). When the option
-# is ON, this macro will include the source subdirectories, and
-# therefore, will build and install the library binary.
-#
-# For libraries that have regression tests, and when testing is
-# enabled globally by the BUILD_TESTING option, this macro also
-# defines the TEST_BOOST_LIBNAME option (defaults to ON). When ON, the
-# generated makefiles/project files will contain regression tests for
-# this library.
-#
-# Example:
-# boost_library_project(
-# Thread
-# SRCDIRS src
-# TESTDIRS test
-# )
-macro(boost_library_project LIBNAME)
- parse_arguments(THIS_PROJECT
- "SRCDIRS;TESTDIRS"
- ""
- ${ARGN}
- )
-
- string(TOUPPER "BUILD_BOOST_${LIBNAME}" BOOST_BUILD_LIB_OPTION)
- if (THIS_PROJECT_SRCDIRS)
- # This Boost library has source directories, so provide an option
- # BUILD_BOOST_LIBNAME that allows one to turn on/off building of
- # the library.
- option(${BOOST_BUILD_LIB_OPTION}
- "Build Boost.${LIBNAME} (prefer make targets, not this, to build individual libs)"
- ON)
- else (THIS_PROJECT_SRCDIRS)
- # This Boost library has no source directories, and therefore does
- # not require building. Always enable it (but don't make it an
- # option in the cache).
- set(${BOOST_BUILD_LIB_OPTION} ON)
- endif (THIS_PROJECT_SRCDIRS)
-
- if(${BOOST_BUILD_LIB_OPTION})
- string(TOLOWER "${LIBNAME}" libname)
- project(${libname})
-
- if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME})
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME})
- endif(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME})
-
- # Include each of the source directories
- foreach(SUBDIR ${THIS_PROJECT_SRCDIRS})
- add_subdirectory(${SUBDIR})
- endforeach(SUBDIR ${THIS_PROJECT_SRCDIRS})
-
- if(BUILD_TESTING AND THIS_PROJECT_TESTDIRS)
- # Testing is enabled globally and this project has some
- # tests. So, add a testing option.
- string(TOUPPER "TEST_BOOST_${LIBNAME}" BOOST_TEST_LIB_OPTION)
- option(${BOOST_TEST_LIB_OPTION}
- "Enable testing of Boost.${LIBNAME}"
- ON)
-
- # Only include the test directories when testing is enabled for
- # this project.
- if(${BOOST_TEST_LIB_OPTION})
- foreach(SUBDIR ${THIS_PROJECT_TESTDIRS})
- add_subdirectory(${SUBDIR})
- endforeach(SUBDIR ${THIS_PROJECT_TESTDIRS})
- endif(${BOOST_TEST_LIB_OPTION})
- endif(BUILD_TESTING AND THIS_PROJECT_TESTDIRS)
- endif(${BOOST_BUILD_LIB_OPTION})
-endmacro(boost_library_project)
-
-# This macro is an internal utility macro that builds the name of a
-# particular variant of a library
-#
-# boost_library_variant_target_name(feature1 feature2 ...)
-#
-# where feature1, feature2, etc. are the names of features to be
-# included in this variant, e.g., MULTI_THREADED, DEBUG.
-#
-# This macro sets two macros:
-#
-# VARIANT_TARGET_NAME: The suffix that should be appended to the
-# name of the library target to name this variant of the
-# library. For example, this might be "-mt-static" for a static,
-# multi-threaded variant. It should be used to name the CMake
-# library target, e.g., boost_signals-mt-static.
-#
-# VARIANT_VERSIONED_NAME: The suffix that will be added to the name
-# of the generated library, containing information about the
-# particular version of the library and the toolset used to build
-# this library. For example, this might be "-gcc41-mt-1_34" for the
-# multi-threaded, release variant of the library in Boost 1.34.0 as
-# compiled with GCC 4.1.
-macro(boost_library_variant_target_name)
- set(VARIANT_TARGET_NAME "")
-
- # Add -mt for multi-threaded libraries
- list_contains(VARIANT_IS_MT MULTI_THREADED ${ARGN})
- if (VARIANT_IS_MT)
- set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-mt")
-
- # If we're creating versioned names, tack on "-mt"
- set(VARIANT_VERSIONED_NAME "${VARIANT_VERSIONED_NAME}-mt")
- endif (VARIANT_IS_MT)
-
- # Add -static for static libraries, -shared for shared libraries
- list_contains(VARIANT_IS_STATIC STATIC ${ARGN})
- if (VARIANT_IS_STATIC)
- set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-static")
- else (VARIANT_IS_STATIC)
- set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-shared")
- endif (VARIANT_IS_STATIC)
-
- # The versioned name starts with the full Boost toolset
- set(VARIANT_VERSIONED_NAME "-${BOOST_TOOLSET}")
-
- # Compute the ABI tag, which depends on various kinds of options
- set(VARIANT_ABI_TAG "")
-
- # TODO: Linking statically to the runtime library
- # TODO: Using debug versions of the standard/runtime support libs
- # TODO: using debug build of Python
- # TODO: STLport rather than default library
- # TODO: STLport's deprecated iostreams
-
- # Add -debug for debug libraries
- list_contains(VARIANT_IS_DEBUG DEBUG ${ARGN})
- if (VARIANT_IS_DEBUG)
- set(VARIANT_TARGET_NAME "${VARIANT_TARGET_NAME}-debug")
- set(VARIANT_ABI_TAG "${VARIANT_ABI_TAG}d")
- endif (VARIANT_IS_DEBUG)
-
- # If there is an ABI tag, append it to the versioned name
- if (VARIANT_ABI_TAG)
- set(VARIANT_VERSIONED_NAME "${VARIANT_VERSIONED_NAME}-${VARIANT_ABI_TAG}")
- endif (VARIANT_ABI_TAG)
-
- # Append the Boost version number to the versioned name
- if(BOOST_VERSION_SUBMINOR GREATER 0)
- set(VARIANT_VERSIONED_NAME
- "${VARIANT_VERSIONED_NAME}-${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}_${BOOST_VERSION_SUBMINOR}")
- else(BOOST_VERSION_SUBMINOR GREATER 0)
- set(VARIANT_VERSIONED_NAME
- "${VARIANT_VERSIONED_NAME}-${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}")
- endif(BOOST_VERSION_SUBMINOR GREATER 0)
-endmacro(boost_library_variant_target_name)
-
-# This macro is an internal utility macro that builds a particular
-# variant of a boost library.
-#
-# boost_library_variant(libname
-# feature1 feature2 ...)
-#
-# where libname is the name of the Boost library (e.g.,
-# "boost_filesystem") and feature1, feature2, ... are the features
-# that will be used in this variant.
-#
-# This macro will define a new library target based on libname and the
-# specific variant name (see boost_library_variant_target_name), which
-# depends on the utility target libname. The compilation and linking
-# flags for this library are defined by THIS_LIB_COMPILE_FLAGS,
-# THIS_LIB_LINK_FLAGS, THIS_LIB_LINK_LIBS, and all of the compile and
-# linking flags implied by the features provided.
-#
-# If any of the features listed conflict with this library, no new
-# targets will be built. For example, if the library provides the
-# option NOT_MULTI_THREADED, and one of the features provided is
-# MULTI_THREADED, this macro will essentially be a no-op.
-macro(boost_library_variant LIBNAME)
- set(THIS_VARIANT_COMPILE_FLAGS "${THIS_LIB_COMPILE_FLAGS}")
- set(THIS_VARIANT_LINK_FLAGS "${THIS_LIB_LINK_FLAGS}")
- set(THIS_VARIANT_LINK_LIBS ${THIS_LIB_LINK_LIBS})
-
- # Determine if it is okay to build this variant
- set(THIS_VARIANT_OKAY TRUE)
- foreach(ARG ${ARGN})
- # If the library itself stated that we cannot build this variant,
- # don't. For example, we're trying to build a shared library
- # variant, but the user specified NO_SHARED in the requirements of
- # the library.
- if (THIS_LIB_NO_${ARG})
- set(THIS_VARIANT_OKAY FALSE)
- endif (THIS_LIB_NO_${ARG})
-
- # If the user specified that we should not build any variants of
- # this kind, don't. For example, if the BUILD_SHARED option is
- # off, don't build shared libraries.
- if(NOT BUILD_${ARG})
- set(THIS_VARIANT_OKAY FALSE)
- endif(NOT BUILD_${ARG})
-
- # Accumulate compile and link flags
- set(THIS_VARIANT_COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS} ${THIS_LIB_${ARG}_COMPILE_FLAGS} ${${ARG}_COMPILE_FLAGS}")
- set(THIS_VARIANT_LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS} ${THIS_LIB_${ARG}_LINK_FLAGS} ${${ARG}_LINK_FLAGS}")
- set(THIS_VARIANT_LINK_LIBS ${THIS_VARIANT_LINK_LIBS} ${THIS_LIB_${ARG}_LINK_LIBS} ${${ARG}_LINK_LIBS})
- endforeach(ARG ${ARGN})
-
- if (THIS_VARIANT_OKAY)
- # Use the appropriate C++ flags for debug vs. release variants
- list_contains(THIS_LIB_IS_DEBUG "DEBUG" ${ARGN})
- if (THIS_LIB_IS_DEBUG)
- set(THIS_VARIANT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} ${THIS_VARIANT_COMPILE_FLAGS}")
- set(THIS_VARIANT_LINK_FLAGS "${CMAKE_LINK_FLAGS_DEBUG} ${THIS_VARIANT_LINK_FLAGS}")
- else (THIS_LIB_IS_DEBUG)
- set(THIS_VARIANT_COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} ${THIS_VARIANT_COMPILE_FLAGS}")
- set(THIS_VARIANT_LINK_FLAGS "${CMAKE_LINK_FLAGS_RELEASE} ${THIS_VARIANT_LINK_FLAGS}")
- endif (THIS_LIB_IS_DEBUG)
-
- # Determine the suffix for this library target
- boost_library_variant_target_name(${ARGN})
- set(VARIANT_LIBNAME "${LIBNAME}${VARIANT_TARGET_NAME}")
-
- # We handle static vs. dynamic libraries differently
- list_contains(THIS_LIB_IS_STATIC "STATIC" ${ARGN})
- if (THIS_LIB_IS_STATIC)
- # If the STATIC_TAG flag was set, we append "-s" to the name of
- # the library. This is an unfortunate hack, needed only for the
- # test library.
- if (THIS_LIB_STATIC_TAG)
- set(THIS_LIB_STATIC_TAG "-s")
- else(THIS_LIB_STATIC_TAG)
- set(THIS_LIB_STATIC_TAG "")
- endif(THIS_LIB_STATIC_TAG)
-
- # On Windows, we need static and shared libraries to have
- # different names, so we follow the Boost.Build version 2 style
- # and prepend "lib" to the name.
- if(WIN32 AND NOT CYGWIN)
- set(LIBPREFIX "lib")
- else(WIN32 AND NOT CYGWIN)
- set(LIBPREFIX "")
- endif(WIN32 AND NOT CYGWIN)
-
- # Add the library itself
- add_library(${VARIANT_LIBNAME} STATIC ${THIS_LIB_SOURCES})
-
- # Set properties on this library
- set_target_properties(${VARIANT_LIBNAME}
- PROPERTIES
- OUTPUT_NAME "${LIBPREFIX}${LIBNAME}${VARIANT_VERSIONED_NAME}${THIS_LIB_STATIC_TAG}"
- CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS}"
- LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS}"
- )
- elseif (THIS_LIB_MODULE)
- # Add a module
- add_library(${VARIANT_LIBNAME} MODULE ${THIS_LIB_SOURCES})
-
- # Set properties on this library
- set_target_properties(${VARIANT_LIBNAME}
- PROPERTIES
- OUTPUT_NAME "${LIBNAME}${VARIANT_VERSIONED_NAME}"
- CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS}"
- LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS}"
- SOVERSION "${BOOST_VERSION}"
- )
- else (THIS_LIB_IS_STATIC)
- # Add a module
- add_library(${VARIANT_LIBNAME} SHARED ${THIS_LIB_SOURCES})
-
- # Set properties on this library
- set_target_properties(${VARIANT_LIBNAME}
- PROPERTIES
- OUTPUT_NAME "${LIBNAME}${VARIANT_VERSIONED_NAME}"
- CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "${THIS_VARIANT_COMPILE_FLAGS}"
- LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS}"
- SOVERSION "${BOOST_VERSION}"
- )
- endif (THIS_LIB_IS_STATIC)
-
- # The basic LIBNAME target depends on each of the variants
- add_dependencies(${LIBNAME} ${VARIANT_LIBNAME})
-
- # Link against whatever libraries this library depends on
- target_link_libraries(${VARIANT_LIBNAME} ${THIS_VARIANT_LINK_LIBS})
- foreach(dependency ${THIS_LIB_DEPENDS})
- target_link_libraries(${VARIANT_LIBNAME} "${dependency}${VARIANT_TARGET_NAME}")
- endforeach(dependency "${THIS_LIB_DEPENDS}")
-
- # Installation of this library variant
- install(TARGETS ${VARIANT_LIBNAME} DESTINATION lib)
- endif (THIS_VARIANT_OKAY)
-endmacro(boost_library_variant)
-
-# Updates the set of default build variants to account for variations
-# in the given feature.
-#
-# boost_add_default_variant(feature-val1 feature-val2 ...)
-#
-# Each new feature creates a new set of build variants using that
-# feature. For example, writing:
-#
-# boost_add_default_variant(SINGLE_THREADED MULTI_THREADED)
-#
-# Will create single- and multi-threaded variants of every default
-# library variant already defined, doubling the number of variants
-# that will be built. See the top-level CMakeLists.txt for the set of
-# default variants.
-#
-# Variables affected:
-#
-# BOOST_DEFAULT_VARIANTS:
-# This variable describes all of the variants that will be built
-# by default, and will be updated with each invocation of
-# boost_add_default_variant. The variable itself is a list, where
-# each element in the list contains a colon-separated string
-# naming a specific set of features for that variant, e.g.,
-# STATIC:DEBUG:SINGLE_THREADED.
-#
-# BOOST_ADDLIB_ARG_NAMES:
-#
-# This variable describes all of the feature-specific arguments
-# that can be used for the boost_library macro, separated by
-# semicolons. For example, given the use of
-# boost_add_default_variant above, this variable will contain (at
-# least)
-#
-# SINGLE_THREADED_COMPILE_FLAGS;SINGLE_THREADED_LINK_FLAGS;
-# MULTI_THREADED_COMPILE_FLAGS;MULTI_THREADED_LINK_FLAGS
-#
-# When this variable is used in boost_library, it turns these
-# names into feature-specific options. For example,
-# MULTI_THREADED_COMPILE_FLAGS provides extra compile flags to be
-# used only for multi-threaded variants of the library.
-#
-# BOOST_ADDLIB_OPTION_NAMES:
-#
-# Like BOOST_ADDLIB_ARG_NAMES, this variable describes
-# feature-specific options to boost_library that can be used to
-# turn off building of the library when the variant would require
-# certain features. For example, the NO_SINGLE_THREADED option
-# turns off building of single-threaded variants for a library.
-macro(boost_add_default_variant)
- # Update BOOST_DEFAULT_VARIANTS
- if (BOOST_DEFAULT_VARIANTS)
- set(BOOST_DEFAULT_VARIANTS_ORIG ${BOOST_DEFAULT_VARIANTS})
- set(BOOST_DEFAULT_VARIANTS)
- foreach(VARIANT ${BOOST_DEFAULT_VARIANTS_ORIG})
- foreach(FEATURE ${ARGN})
- list(APPEND BOOST_DEFAULT_VARIANTS "${VARIANT}:${FEATURE}")
- endforeach(FEATURE ${ARGN})
- endforeach(VARIANT ${BOOST_DEFAULT_VARIANTS_ORIG})
- set(BOOST_DEFAULT_VARIANTS_ORIG)
- else (BOOST_DEFAULT_VARIANTS)
- set(BOOST_DEFAULT_VARIANTS ${ARGN})
- endif (BOOST_DEFAULT_VARIANTS)
-
- # Feature flag options, used by the boost_library macro
- foreach(FEATURE ${ARGN})
- set(BOOST_ADDLIB_ARG_NAMES
- "${BOOST_ADDLIB_ARG_NAMES};${FEATURE}_COMPILE_FLAGS;${FEATURE}_LINK_FLAGS:${FEATURE}_LINK_LIBS")
- set(BOOST_ADDLIB_OPTION_NAMES "${BOOST_ADDLIB_OPTION_NAMES};NO_${FEATURE}")
- endforeach(FEATURE ${ARGN})
-endmacro(boost_add_default_variant)
-
-# Creates a new Boost library target that generates a compiled library
-# (.a, .lib, .dll, .so, etc) from source files. This routine will
-# actually build several different variants of the same library, with
-# different compilation options, as determined by the set of "default"
-# library variants.
-#
-# boost_library(libname
-# source1 source2 ...
-# [COMPILE_FLAGS compileflags]
-# [feature_COMPILE_FLAGS compileflags]
-# [LINK_FLAGS linkflags]
-# [feature_LINK_FLAGS linkflags]
-# [LINK_LIBS linklibs]
-# [feature_LINK_LIBS linklibs]
-# [DEPENDS libdepend1 libdepend2 ...]
-# [STATIC_TAG]
-# [MODULE]
-# [NOT_feature])
-#
-# where libname is the name of Boost library binary (e.g.,
-# "boost_regex") and source1, source2, etc. are the source files used
-# to build the library, e.g., cregex.cpp.
-#
-# This macro has a variety of options that affect its behavior. In
-# several cases, we use the placeholder "feature" in the option name
-# to indicate that there are actually several different kinds of
-# options, each referring to a different build feature, e.g., shared
-# libraries, multi-threaded, debug build, etc. For a complete listing
-# of these features, please refer to the CMakeLists.txt file in the
-# root of the Boost distribution, which defines the set of features
-# that will be used to build Boost libraries by default.
-#
-# The options that affect this macro's behavior are:
-#
-# COMPILE_FLAGS: Provides additional compilation flags that will be
-# used when building all variants of the library. For example, one
-# might want to add "-DBOOST_SIGNALS_NO_LIB=1" through this option
-# (which turns off auto-linking for the Signals library while
-# building it).
-#
-# feature_COMPILE_FLAGS: Provides additional compilation flags that
-# will be used only when building variants of the library that
-# include the given feature. For example,
-# MULTI_THREADED_COMPILE_FLAGS are additional flags that will be
-# used when building a multi-threaded variant, while
-# SHARED_COMPILE_FLAGS will be used when building a shared library
-# (as opposed to a static library).
-#
-# LINK_FLAGS: Provides additional flags that will be passed to the
-# linker when linking each variant of the library. This option
-# should not be used to link in additional libraries; see LINK_LIBS
-# and DEPENDS.
-#
-# feature_LINK_FLAGS: Provides additional flags that will be passed
-# to the linker when building variants of the library that contain a
-# specific feature, e.g., MULTI_THREADED_LINK_FLAGS. This option
-# should not be used to link in additional libraries; see
-# feature_LINK_LIBS.
-#
-# LINK_LIBS: Provides additional libraries against which each of the
-# library variants will be linked. For example, one might provide
-# "expat" as options to LINK_LIBS, to state that each of the library
-# variants will link against the expat library binary. Use LINK_LIBS
-# for libraries external to Boost; for Boost libraries, use DEPENDS.
-#
-# feature_LINK_LIBS: Provides additional libraries for specific
-# variants of the library to link against. For example,
-# MULTI_THREADED_LINK_LIBS provides extra libraries to link into
-# multi-threaded variants of the library.
-#
-# DEPENDS: States that this Boost libraries depends on and links
-# against another Boost library. The arguments to DEPENDS should be
-# the unversioned name of the Boost library, such as
-# "boost_filesystem". Like LINK_LIBS, this option states that all
-# variants of the library being built will link against the stated
-# libraries. Unlike LINK_LIBS, however, DEPENDS takes particular
-# library variants into account, always linking the variant of one
-# Boost library against the same variant of the other Boost
-# library. For example, if the boost_mpi_python library DEPENDS on
-# boost_python, multi-threaded variants of boost_mpi_python will
-# link against multi-threaded variants of boost_python.
-#
-# STATIC_TAG: States that the name of static library variants on
-# Unix need to be named differently from shared library
-# variants. This particular option should only be used in rare cases
-# where the static and shared library variants are incompatible,
-# such that linking against the shared library rather than the
-# static library will cause features. When this option is provided,
-# static libraries on Unix variants will have "-s" appended to their
-# names. Note: we hope that this is a temporary solution. At
-# present, it is only used by the Test library.
-#
-# MODULE: This option states that, when building a shared library,
-# the shared library should be built as a module rather than a
-# normal shared library. Modules have special meaning an behavior on
-# some platforms, such as Mac OS X.
-#
-# NOT_feature: States that library variants containing a particular
-# feature should not be built. For example, passing
-# NOT_SINGLE_THREADED suppresses generation of single-threaded
-# variants of this library.
-#
-#
-# Example:
-# boost_library(
-# boost_thread
-# barrier.cpp condition.cpp exceptions.cpp mutex.cpp once.cpp
-# recursive_mutex.cpp thread.cpp tss_hooks.cpp tss_dll.cpp tss_pe.cpp
-# tss.cpp xtime.cpp
-# SHARED_COMPILE_FLAGS "-DBOOST_THREAD_BUILD_DLL=1"
-# STATIC_COMPILE_FLAGS "-DBOOST_THREAD_BUILD_LIB=1"
-# NO_SINGLE_THREADED
-# )
-#
-# TODO:
-# - Rename this to boost_add_library.
-macro(boost_library LIBNAME)
- parse_arguments(THIS_LIB
- "DEPENDS;COMPILE_FLAGS;LINK_FLAGS;LINK_LIBS;${BOOST_ADDLIB_ARG_NAMES}"
- "STATIC_TAG;MODULE;${BOOST_ADDLIB_OPTION_NAMES}"
- ${ARGN}
- )
- set(THIS_LIB_SOURCES ${THIS_LIB_DEFAULT_ARGS})
-
- # A top-level target that refers to all of the variants of the
- # library, collectively.
- add_custom_target(${LIBNAME})
-
- # Build each of the default library variants
- foreach(VARIANT_STR ${BOOST_DEFAULT_VARIANTS})
- string(REPLACE ":" ";" VARIANT ${VARIANT_STR})
- separate_arguments(VARIANT)
- boost_library_variant(${LIBNAME} ${VARIANT})
- endforeach(VARIANT_STR ${BOOST_DEFAULT_VARIANTS})
-endmacro(boost_library)
-
-# TODO: Create boost_add_executable, which deals with variants well
\ No newline at end of file

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-testing.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,348 +0,0 @@
-##########################################################################
-# Regression Testing Support for Boost #
-##########################################################################
-# Copyright (C) 2007 Douglas Gregor <doug.gregor_at_[hidden]> #
-# Copyright (C) 2007 Troy Straszheim #
-# #
-# Distributed under the Boost Software License, Version 1.0. #
-# See accompanying file LICENSE_1_0.txt or copy at #
-# http://www.boost.org/LICENSE_1_0.txt #
-##########################################################################
-# This file provides a set of CMake macros that support regression
-# testing for Boost libraries. For each of the test macros below, the
-# first argument, testname, states the name of the test that will be
-# created. If no other arguments are provided, the source file
-# testname.cpp will be used as the source file; otherwise, source
-# files should be listed immediately after the name of the test.
-#
-# The macros for creating regression tests are:
-# boost_test_run: Builds an executable and runs it as a test. The test
-# succeeds if it builds and returns 0 when executed.
-#
-# boost_test_run_fail: Builds an executable and runs it as a test. The
-# test succeeds if it builds but returns a non-zero
-# exit code when executed.
-#
-# boost_test_compile: Tests that the given source file compiles without
-# any errors.
-#
-# boost_test_compile_fail: Tests that the given source file produces
-# errors when compiled.
-
-# User-controlled option that can be used to enable/disable regression
-# testing. By default, we disable testing, because most users won't
-# want or need to perform regression testing on Boost. The Boost build
-# is significantly faster when we aren't also building regression
-# tests.
-option(BUILD_TESTING "Enable testing" OFF)
-include(CTest)
-
-# This macro is an internal utility macro that helps parse the
-# arguments passed to the Boost testing commands. It will generally
-# not be used by Boost developers.
-#
-# boost_test_parse_args(testname
-# [source1 source2 ...]
-# [ARGS arg1 arg2... ]
-# [COMPILE_FLAGS compileflags]
-# [LINK_FLAGS linkflags]
-# [LINK_LIBS linklibs]
-# [DEPENDS libdepend1 libdepend2 ...])
-#
-# testname is the name of the test. The remaining arguments passed to
-# this macro will be parsed and categorized for the developer-level
-# test macros to use.
-#
-# Variables affected:
-#
-# BOOST_TEST_OKAY: Will be set to TRUE if it is okay to build and
-# run this test.
-#
-# BOOST_TEST_SOURCES: Will be populated with the set of source files
-# that should be used to compile this test. If the user has provided
-# source files, BOOST_TEST_SOURCES will contain those; otherwise,
-# BOOST_TEST_SOURCES will only contain "testname.cpp".
-#
-# BOOST_TEST_arg: Will be populated with the arguments provided for
-# the arguemnt "arg", where "arg" can be any of the extra arguments
-# specified above.
-macro(boost_test_parse_args testname)
- set(BOOST_TEST_OKAY TRUE)
- set(BOOST_TEST_COMPILE_FLAGS "")
- parse_arguments(BOOST_TEST
- "LINK_LIBS;LINK_FLAGS;DEPENDS;COMPILE_FLAGS;ARGS"
- ""
- ${ARGN}
- )
-
- # Check each of the dependencies to see if we can still build this
- # test.
- foreach(ARG ${BOOST_TEST_DEPENDS})
- get_target_property(DEPEND_TYPE ${ARG} TYPE)
- get_target_property(DEPEND_LOCATION ${ARG} LOCATION)
- # If building static libraries is turned off, don't try to build
- # the test
- if (NOT BUILD_STATIC AND ${DEPEND_TYPE} STREQUAL "STATIC_LIBRARY")
- set(BOOST_TEST_OKAY FALSE)
- endif (NOT BUILD_STATIC AND ${DEPEND_TYPE} STREQUAL "STATIC_LIBRARY")
-
- # If building shared libraries is turned off, don't try to build
- # the test
- if (NOT BUILD_SHARED AND ${DEPEND_TYPE} STREQUAL "SHARED_LIBRARY")
- set(BOOST_TEST_OKAY FALSE)
- endif (NOT BUILD_SHARED AND ${DEPEND_TYPE} STREQUAL "SHARED_LIBRARY")
- endforeach(ARG ${BOOST_TEST_DEPENDS})
-
- # Setup the SOURCES variables. If no sources are specified, use the
- # name of the test.cpp
- if (BOOST_TEST_DEFAULT_ARGS)
- set(BOOST_TEST_SOURCES ${BOOST_TEST_DEFAULT_ARGS})
- else (BOOST_TEST_DEFAULT_ARGS)
- set(BOOST_TEST_SOURCES "${testname}.cpp")
- endif (BOOST_TEST_DEFAULT_ARGS)
-
- # If testing is turned off, this test is not okay
- if (NOT BUILD_TESTING)
- set(BOOST_TEST_OKAY FALSE)
- endif(NOT BUILD_TESTING)
-endmacro(boost_test_parse_args)
-
-# This macro creates a Boost regression test that will be executed. If
-# the test can be built, executed, and exits with a return code of
-# zero, it will be considered to have passed.
-#
-# boost_test_run(testname
-# [source1 source2 ...]
-# [ARGS arg1 arg2... ]
-# [COMPILE_FLAGS compileflags]
-# [LINK_FLAGS linkflags]
-# [LINK_LIBS linklibs]
-# [DEPENDS libdepend1 libdepend2 ...])
-#
-# testname is the name of the test. source1, source2, etc. are the
-# source files that will be built and linked into the test
-# executable. If no source files are provided, the file "testname.cpp"
-# will be used instead.
-#
-# There are several optional arguments to control how the regression
-# test is built and executed:
-#
-# ARGS: Provides additional arguments that will be passed to the
-# test executable when it is run.
-#
-# COMPILE_FLAGS: Provides additional compilation flags that will be
-# used when building this test. For example, one might want to add
-# "-DBOOST_SIGNALS_ASSERT=1" to turn on assertions within the library.
-#
-# LINK_FLAGS: Provides additional flags that will be passed to the
-# linker when linking the test excecutable. This option should not
-# be used to link in additional libraries; see LINK_LIBS and
-# DEPENDS.
-#
-# LINK_LIBS: Provides additional libraries against which the test
-# executable will be linked. For example, one might provide "expat"
-# as options to LINK_LIBS, to state that this executable should be
-# linked against the external "expat" library. Use LINK_LIBS for
-# libraries external to Boost; for Boost libraries, use DEPENDS.
-#
-# DEPENDS: States that this test executable depends on and links
-# against another Boost library. The argument to DEPENDS should be
-# the name of a particular variant of a Boost library, e.g.,
-# boost_signals-static.
-#
-# Example:
-# boost_test_run(signal_test DEPENDS boost_signals-static)
-#
-# TODO:
-# - Improve handling of DEPENDS, so that we can specify just the
-# library's abstract target (e.g., "boost_signals"), and possibly
-# some features required for building the test (e.g.,
-# MULTI_THREADED, STATIC). The test macros should then pick the
-# best library variant available to meet those features and the
-# current build variant (Debug or Release).
-macro(boost_test_run testname)
- boost_test_parse_args(${testname} ${ARGN})
- if (BOOST_TEST_OKAY)
- add_executable(${testname} ${BOOST_TEST_SOURCES})
- set_target_properties(${testname}
- PROPERTIES
- COMPILE_FLAGS "${BOOST_TEST_COMPILE_FLAGS}"
- LINK_FLAGS "${BOOST_TEST_LINK_FLAGS}"
- OUTPUT_NAME ${PROJECT_NAME}/${testname})
- target_link_libraries(${testname} ${BOOST_TEST_DEPENDS})
- target_link_libraries(${testname} ${BOOST_TEST_LINK_LIBS})
- add_test("${PROJECT_NAME}::${testname}"
- ${EXECUTABLE_OUTPUT_PATH}/${PROJECT_NAME}/${testname} ${BOOST_TEST_ARGS})
- endif(BOOST_TEST_OKAY)
-endmacro(boost_test_run)
-
-# This macro creates a Boost regression test that will be executed. If
-# the test can be built, executed, and exits with a return code that
-# is not zero, it will be considered to have passed.
-#
-# boost_test_run_fail(testname
-# [source1 source2 ...]
-# [ARGS arg1 arg2... ]
-# [COMPILE_FLAGS compileflags]
-# [LINK_FLAGS linkflags]
-# [LINK_LIBS linklibs]
-# [DEPENDS libdepend1 libdepend2 ...])
-#
-# testname is the name of the test. source1, source2, etc. are the
-# source files that will be built and linked into the test
-# executable. If no source files are provided, the file "testname.cpp"
-# will be used instead.
-#
-# There are several optional arguments to control how the regression
-# test is built and executed:
-#
-# ARGS: Provides additional arguments that will be passed to the
-# test executable when it is run.
-#
-# COMPILE_FLAGS: Provides additional compilation flags that will be
-# used when building this test. For example, one might want to add
-# "-DBOOST_SIGNALS_ASSERT=1" to turn on assertions within the library.
-#
-# LINK_FLAGS: Provides additional flags that will be passed to the
-# linker when linking the test excecutable. This option should not
-# be used to link in additional libraries; see LINK_LIBS and
-# DEPENDS.
-#
-# LINK_LIBS: Provides additional libraries against which the test
-# executable will be linked. For example, one might provide "expat"
-# as options to LINK_LIBS, to state that this executable should be
-# linked against the external "expat" library. Use LINK_LIBS for
-# libraries external to Boost; for Boost libraries, use DEPENDS.
-#
-# DEPENDS: States that this test executable depends on and links
-# against another Boost library. The argument to DEPENDS should be
-# the name of a particular variant of a Boost library, e.g.,
-# boost_signals-static.
-#
-# Example:
-# boost_test_run_fail(prg_exec_fail1 DEPENDS boost_prg_exec_monitor-static)
-#
-# TODO:
-# - Improve handling of DEPENDS, so that we can specify just the
-# library's abstract target (e.g., "boost_signals"), and possibly
-# some features required for building the test (e.g.,
-# MULTI_THREADED, STATIC). The test macros should then pick the
-# best library variant available to meet those features and the
-# current build variant (Debug or Release).
-macro(boost_test_run_fail testname)
- boost_test_parse_args(${testname} ${ARGN})
- if(BOOST_TEST_OKAY)
- add_executable(${testname} ${BOOST_TEST_SOURCES})
- set_target_properties(${testname}
- PROPERTIES
- COMPILE_FLAGS "${BOOST_TEST_COMPILE_FLAGS}"
- LINK_FLAGS "${BOOST_TEST_LINK_FLAGS}"
- OUTPUT_NAME ${PROJECT_NAME}/${testname})
- target_link_libraries(${testname} ${BOOST_TEST_DEPENDS})
- target_link_libraries(${testname} ${BOOST_TEST_LINK_LIBS})
- add_test("${PROJECT_NAME}::${testname}"
- ${EXECUTABLE_OUTPUT_PATH}/${PROJECT_NAME}/${testname} ${BOOST_TEST_ARGS})
- set_tests_properties("${PROJECT_NAME}::${testname}"
- PROPERTIES WILL_FAIL TRUE)
- endif(BOOST_TEST_OKAY)
-endmacro(boost_test_run_fail)
-
-# Under construction...
-
-macro(boost_test_link testname)
- boost_test_parse_args(${testname} ${ARGN})
- if(BOOST_TEST_OKAY)
- add_test("${PROJECT_NAME}::${testname}"
- ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${Boost_SOURCE_DIR}/tools/build/CMake/LinkTest"
- "${Boost_BINARY_DIR}/tools/build/CMake/LinkTest"
- --build-generator "${CMAKE_GENERATOR}"
- --build-makeprogram "${MAKEPROGRAM}"
- --build-project LinkTest
- --build-options -DSOURCE=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES} -DINCLUDES=${Boost_SOURCE_DIR} -DCOMPILE_FLAGS="${BOOST_TEST_COMPILE_FLAGS}")
- endif(BOOST_TEST_OKAY)
-endmacro(boost_test_link)
-
-# This macro creates a Boost regression test that will be compiled,
-# but not linked or executed. If the test can be compiled with no
-# failures, the test passes.
-#
-# boost_test_compile(testname
-# [source1]
-# [COMPILE_FLAGS compileflags])
-#
-# testname is the name of the test. source1 is the name of the source
-# file that will be built. If no source file is provided, the file
-# "testname.cpp" will be used instead.
-#
-# The COMPILE_FLAGS argument provides additional arguments that will
-# be passed to the compiler when building this test.
-
-# Example:
-# boost_test_compile(advance)
-macro(boost_test_compile testname)
- boost_test_parse_args(${testname} ${ARGN})
-
- # Determine the include directories to pass along to the underlying
- # project.
- get_directory_property(BOOST_TEST_INCLUDE_DIRS INCLUDE_DIRECTORIES)
- set(BOOST_TEST_INCLUDES "")
- foreach(DIR ${BOOST_TEST_INCLUDE_DIRS})
- set(BOOST_TEST_INCLUDES "${BOOST_TEST_INCLUDES}:${DIR}")
- endforeach(DIR ${BOOST_TEST_INCLUDE_DIRS})
-
- if(BOOST_TEST_OKAY)
- add_test("${PROJECT_NAME}::${testname}"
- ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${Boost_SOURCE_DIR}/tools/build/CMake/CompileTest"
- "${Boost_BINARY_DIR}/tools/build/CMake/CompileTest"
- --build-generator "${CMAKE_GENERATOR}"
- --build-makeprogram "${MAKEPROGRAM}"
- --build-project CompileTest
- --build-options -DSOURCE=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES} -DINCLUDES=${BOOST_TEST_INCLUDES} -DCOMPILE_FLAGS=${BOOST_TEST_COMPILE_FLAGS})
- endif(BOOST_TEST_OKAY)
-endmacro(boost_test_compile)
-
-# This macro creates a Boost regression test that will be compiled,
-# but compilation should fail. It is used to test, e.g., that certain
-# disallowed syntax does in fact cause a compilation failure.
-#
-# boost_test_compile_fail(testname
-# [source1]
-# [COMPILE_FLAGS compileflags])
-#
-# testname is the name of the test. source1 is the name of the source
-# file that will be built. If no source file is provided, the file
-# "testname.cpp" will be used instead.
-#
-# The COMPILE_FLAGS argument provides additional arguments that will
-# be passed to the compiler when building this test.
-
-# Example:
-# boost_test_compile_fail(function_test_fail1)
-macro(boost_test_compile_fail testname)
- boost_test_parse_args(${testname} ${ARGN})
-
- # Determine the include directories to pass along to the underlying
- # project.
- get_directory_property(BOOST_TEST_INCLUDE_DIRS INCLUDE_DIRECTORIES)
- set(BOOST_TEST_INCLUDES "")
- foreach(DIR ${BOOST_TEST_INCLUDE_DIRS})
- set(BOOST_TEST_INCLUDES "${BOOST_TEST_INCLUDES}:${DIR}")
- endforeach(DIR ${BOOST_TEST_INCLUDE_DIRS})
-
- if(BOOST_TEST_OKAY)
- add_test("${PROJECT_NAME}::${testname}"
- ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${Boost_SOURCE_DIR}/tools/build/CMake/CompileTest"
- "${Boost_BINARY_DIR}/tools/build/CMake/CompileTest"
- --build-generator "${CMAKE_GENERATOR}"
- --build-makeprogram "${MAKEPROGRAM}"
- --build-project CompileTest
- --build-options -DSOURCE=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES} -DINCLUDES=${BOOST_TEST_INCLUDES} -DCOMPILE_FLAGS=${BOOST_TEST_COMPILE_FLAGS})
- set_tests_properties("${PROJECT_NAME}::${testname}" PROPERTIES WILL_FAIL ON)
- endif(BOOST_TEST_OKAY)
-endmacro(boost_test_compile_fail)

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,12 +0,0 @@
-#
-# organization point for includes
-#
-include(list_contains)
-include(parse_arguments)
-include(CheckCXXSourceCompiles)
-if(CMAKE_COMPILER_IS_GNUCC)
- add_definitions(-pipe)
-endif(CMAKE_COMPILER_IS_GNUCC)
-include(boost-core)
-include(boost-testing)
-

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/filter_out.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/filter_out.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,76 +0,0 @@
-MACRO(FILTER_OUT FILTERS INPUTS OUTPUT)
- # Mimicks Gnu Make's $(filter-out) which removes elements
- # from a list that match the pattern.
- # Arguments:
- # FILTERS - list of patterns that need to be removed
- # INPUTS - list of inputs that will be worked on
- # OUTPUT - the filtered list to be returned
- #
- # Example:
- # SET(MYLIST this that and the other)
- # SET(FILTS this that)
- #
- # FILTER_OUT("${FILTS}" "${MYLIST}" OUT)
- # MESSAGE("OUTPUT = ${OUT}")
- #
- # The output -
- # OUTPUT = and;the;other
- #
- SET(FOUT "")
- FOREACH(INP ${INPUTS})
- SET(FILTERED 0)
- FOREACH(FILT ${FILTERS})
- IF(${FILTERED} EQUAL 0)
- # MESSAGE("FILT=${FILT} INP=${INP}")
- IF("${INP}" MATCHES "${FILT}")
- # MESSAGE("BYE BYE")
- SET(FILTERED 1)
- ENDIF("${INP}" MATCHES "${FILT}")
- ENDIF(${FILTERED} EQUAL 0)
- ENDFOREACH(FILT ${FILTERS})
- IF(${FILTERED} EQUAL 0)
- SET(FOUT ${FOUT} ${INP})
- ENDIF(${FILTERED} EQUAL 0)
- ENDFOREACH(INP ${INPUTS})
- SET(${OUTPUT} ${FOUT})
-ENDMACRO(FILTER_OUT FILTERS INPUTS OUTPUT)
-
-
-
-MACRO(STREQUAL_FILTER_OUT FILTERS INPUTS OUTPUT)
- # Mimicks Gnu Make's $(filter-out) which removes elements
- # from a list that match the pattern.
- # Arguments:
- # FILTERS - list of patterns that need to be removed
- # INPUTS - list of inputs that will be worked on
- # OUTPUT - the filtered list to be returned
- #
- # Example:
- # SET(MYLIST this that and the other)
- # SET(FILTS this that)
- #
- # FILTER_OUT("${FILTS}" "${MYLIST}" OUT)
- # MESSAGE("OUTPUT = ${OUT}")
- #
- # The output -
- # OUTPUT = and;the;other
- #
- SET(FOUT "")
- FOREACH(INP ${INPUTS})
- SET(FILTERED 0)
- FOREACH(FILT ${FILTERS})
- IF(${FILTERED} EQUAL 0)
- # MESSAGE("FILT=${FILT} INP=${INP}")
- IF("${INP}" STREQUAL "${FILT}")
- # MESSAGE("BYE BYE")
- SET(FILTERED 1)
- ENDIF("${INP}" STREQUAL "${FILT}")
- ENDIF(${FILTERED} EQUAL 0)
- ENDFOREACH(FILT ${FILTERS})
- IF(${FILTERED} EQUAL 0)
- SET(FOUT ${FOUT} ${INP})
- ENDIF(${FILTERED} EQUAL 0)
- ENDFOREACH(INP ${INPUTS})
- SET(${OUTPUT} ${FOUT})
-ENDMACRO(STREQUAL_FILTER_OUT FILTERS INPUTS OUTPUT)
-

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/list_contains.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/list_contains.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,20 +0,0 @@
-#
-# usage: LIST_CONTAINS(RESULT STRING_TO_FIND arg1 arg2 arg3 ... argn)
-#
-MACRO(LIST_CONTAINS var value)
- SET(${var})
- FOREACH (value2 ${ARGN})
- IF (${value} STREQUAL ${value2})
- SET(${var} TRUE)
- ENDIF (${value} STREQUAL ${value2})
- ENDFOREACH (value2)
-ENDMACRO(LIST_CONTAINS)
-
-MACRO(CAR var)
- SET(${var} ${ARGV1})
-ENDMACRO(CAR)
-
-MACRO(CDR var junk)
- SET(${var} ${ARGN})
-ENDMACRO(CDR)
-

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/no_dotfile_glob.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/no_dotfile_glob.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,35 +0,0 @@
-# Globs on each regular expression in the ARGN array and removes
-# matches that have a directory component that starts with dot
-# (e.g. matches slash-dot (/.) anywhere in the string)
-
-MACRO(NO_DOTFILE_GLOB where_to)
- FOREACH(regex ${ARGN})
- #
- # if not a regex, do absolute/relative
- #
- IF(NOT ${regex} MATCHES "\\*")
-# MESSAGE("not a regex: >>> ${regex}")
- IF(${regex} MATCHES "^/.*")
- SET(rawglob ${regex})
- ELSE(${regex} MATCHES "^/.*")
- SET(rawglob ${CMAKE_CURRENT_SOURCE_DIR}/${regex})
- ENDIF(${regex} MATCHES "^/.*")
- #
- # else, not a regex, take it literally as absolute/relative
- #
- ELSE(NOT ${regex} MATCHES "\\*")
- IF(${regex} MATCHES "^/.*")
- FILE(GLOB rawglob ${regex})
- ELSE(${regex} MATCHES "^/.*")
- FILE(GLOB rawglob ${CMAKE_CURRENT_SOURCE_DIR}/${regex})
- ENDIF(${regex} MATCHES "^/.*")
- ENDIF(NOT ${regex} MATCHES "\\*")
-# MESSAGE("RAWGLOB=${rawglob}")
- IF(rawglob)
- FILTER_OUT(".*/\\\\.+.*" "${rawglob}" filterglob)
- IF(filterglob)
- LIST(APPEND ${where_to} ${filterglob})
- ENDIF(filterglob)
- ENDIF(rawglob)
- ENDFOREACH(regex ${ARGN})
-ENDMACRO(NO_DOTFILE_GLOB where_to)

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/parse_arguments.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/parse_arguments.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,53 +0,0 @@
-# The PARSE_ARGUMENTS macro will take the arguments of another macro and
-# define several variables. The first argument to PARSE_ARGUMENTS is a
-# prefix to put on all variables it creates. The second argument is a
-# list of names, and the third argument is a list of options. Both of
-# these lists should be quoted. The rest of PARSE_ARGUMENTS are
-# arguments from another macro to be parsed.
-#
-# PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)
-#
-# For each item in options, PARSE_ARGUMENTS will create a variable with
-# that name, prefixed with prefix_. So, for example, if prefix is
-# MY_MACRO and options is OPTION1;OPTION2, then PARSE_ARGUMENTS will
-# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These
-# variables will be set to true if the option exists in the command line
-# or false otherwise.
-#
-# For each item in arg_names, PARSE_ARGUMENTS will create a variable
-# with that name, prefixed with prefix_. Each variable will be filled
-# with the arguments that occur after the given arg_name is encountered
-# up to the next arg_name or the end of the arguments. All options are
-# removed from these lists. PARSE_ARGUMENTS also creates a
-# prefix_DEFAULT_ARGS variable containing the list of all arguments up
-# to the first arg_name encountered.
-
-MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
- SET(DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
-
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- LIST_CONTAINS(is_arg_name ${arg} ${arg_names})
- IF (is_arg_name)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name)
- LIST_CONTAINS(is_option ${arg} ${option_names})
- IF (is_option)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option)
- ENDIF (is_arg_name)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(PARSE_ARGUMENTS)
-

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/sort.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/sort.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,27 +0,0 @@
-################################################################################
-# Functions for list operations.
-################################################################################
-
-MACRO(SORT var_name list)
- # Sort the given list and store it in var_name.
- SET(sort_tmp1 "")
- FOREACH(l ${list})
- SET(sort_inserted 0)
- SET(sort_tmp2 "")
- FOREACH(l1 ${sort_tmp1})
- IF("${l}" STRLESS "${l1}" AND ${sort_inserted} EQUAL 0)
- SET(sort_tmp2 ${sort_tmp2} "${l}" "${l1}")
- SET(sort_inserted 1)
- ELSE("${l}" STRLESS "${l1}" AND ${sort_inserted} EQUAL 0)
- SET(sort_tmp2 ${sort_tmp2} "${l1}")
- ENDIF("${l}" STRLESS "${l1}" AND ${sort_inserted} EQUAL 0)
- ENDFOREACH(l1)
- IF(${sort_inserted} EQUAL 0)
- SET(sort_tmp1 ${sort_tmp1} "${l}")
- ELSE(${sort_inserted} EQUAL 0)
- SET(sort_tmp1 ${sort_tmp2})
- ENDIF(${sort_inserted} EQUAL 0)
- ENDFOREACH(l)
- SET(${var_name} ${sort_tmp1})
-ENDMACRO(SORT)
-

Deleted: sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/unique.cmake
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/unique.cmake 2007-06-08 16:44:03 EDT (Fri, 08 Jun 2007)
+++ (empty file)
@@ -1,11 +0,0 @@
-MACRO(UNIQUE var_name list)
- # Make the given list have only one instance of each unique element and
- # store it in var_name.
- SET(unique_tmp "")
- FOREACH(l ${list})
- IF(NOT "${unique_tmp}" MATCHES "(^|;)${l}(;|$)")
- SET(unique_tmp ${unique_tmp} ${l})
- ENDIF(NOT "${unique_tmp}" MATCHES "(^|;)${l}(;|$)")
- ENDFOREACH(l)
- SET(${var_name} ${unique_tmp})
-ENDMACRO(UNIQUE)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk