$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: dgregor_at_[hidden]
Date: 2007-06-01 09:25:31
Author: dgregor
Date: 2007-06-01 09:25:31 EDT (Fri, 01 Jun 2007)
New Revision: 4414
URL: http://svn.boost.org/trac/boost/changeset/4414
Log:
Rewrite most of boost_library so that we can generate multiple variants of the same library, each with a different versioned name. Still more work to do in this area...
Text files modified: 
   sandbox-branches/boost-cmake/boost_1_34_0/CMakeLists.txt                     |    17 -                                       
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost-core.cmake |   378 +++++++++++++++++++++++++-------------- 
   sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost.cmake      |    15 -                                       
   3 files changed, 243 insertions(+), 167 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-01 09:25:31 EDT (Fri, 01 Jun 2007)
@@ -12,19 +12,10 @@
 set(BOOST_VERSION_SUBMINOR 0)
 set(BOOST_VERSION "${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}.${BOOST_VERSION_SUBMINOR}")
 
-# Whether to build static libraries
-option(BUILD_STATIC_LIBS "Whether to build static libraries" ON)
-
-# Whether to build shared libraries
-option(BUILD_SHARED_LIBS "Whether to build shared libraries" ON)
-
-# Whether to enable threading
-if(MSVC)
-  set(DEFAULT_ENABLE_THREADING ON)
-elseif(MSVC)
-  set(DEFAULT_ENABLE_THREADING OFF)
-endif(MSVC)
-option(ENABLE_THREADING "Whether to enable threading" ${DEFAULT_ENABLE_THREADING})
+option(BUILD_STATIC "Whether to build static libraries" ON)
+option(BUILD_SHARED "Whether to build shared libraries" ON)
+option(BUILD_DEBUG "Whether to build debugging libraries" ON)
+option(BUILD_RELEASE "Whether to build release libraries" ON)
 
 # Always include the Boost source directory, so that we can find
 # include files in boost/
Modified: 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/boost-core.cmake	2007-06-01 09:25:31 EDT (Fri, 01 Jun 2007)
@@ -12,15 +12,10 @@
   set(${varname} ${${varname}} ${ARGN})
 endmacro(append varname)
 
-# This internal macro detects the kind of compiler in use. If a
-# toolset is found, BOOST_VERSIONING_TOOLSET_TAG will be set to the
-# tag string used to describe that toolset.
-# 
-# If WANT_FULL_INFORMATION is TRUE, then this macro will determine
-# complete information. Otherwise, this macro will only determine
-# whether it recognizes the toolset at all.
-macro(boost_detect_toolset WANT_FULL_INFORMATION)
-  set(BOOST_VERSIONING_TOOLSET_TAG)
+# Detects the kind of compiler in use. If a toolset is found,
+# BOOST_VERSIONING_TOOLSET_TAG will be set to the tag string used to
+# describe that toolset.
+if (NOT BOOST_VERSIONING_TOOLSET_TAG)
   if (MSVC60)
     set(BOOST_VERSIONING_TOOLSET_TAG "-vc6")
   elseif(MSVC70)
@@ -33,30 +28,25 @@
   elseif(BORLAND)
     set(BOOST_VERSIONING_TOOLSET_TAG "-bcb")
   elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-    if(WANT_FULL_INFORMATION)
-      # Execute GCC with the -dumpversion option, to give us a version string
-      execute_process(
-        COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion" 
-        OUTPUT_VARIABLE GCC_VERSION_STRING)
-
-      # Match only the major and minor versions of the version string
-      string(REGEX MATCH "[0-9]+.[0-9]+" GCC_MAJOR_MINOR_VERSION_STRING
-        "${GCC_VERSION_STRING}")
-      
-      # Strip out the period between the major and minor versions
-      string(REGEX REPLACE "\\." "" BOOST_VERSIONING_GCC_VERSION
-        "${GCC_MAJOR_MINOR_VERSION_STRING}")
-
-      # Set the GCC versioning toolset
-      set(BOOST_VERSIONING_TOOLSET_TAG "-gcc${BOOST_VERSIONING_GCC_VERSION}")
-    else(WANT_FULL_INFORMATION)
-      set(BOOST_VERSIONING_TOOLSET_TAG "-gcc")
-    endif(WANT_FULL_INFORMATION)
+    # Execute GCC with the -dumpversion option, to give us a version string
+    execute_process(
+      COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion" 
+      OUTPUT_VARIABLE GCC_VERSION_STRING)
+    
+    # Match only the major and minor versions of the version string
+    string(REGEX MATCH "[0-9]+.[0-9]+" GCC_MAJOR_MINOR_VERSION_STRING
+      "${GCC_VERSION_STRING}")
+    
+    # Strip out the period between the major and minor versions
+    string(REGEX REPLACE "\\." "" BOOST_VERSIONING_GCC_VERSION
+      "${GCC_MAJOR_MINOR_VERSION_STRING}")
+    
+    # Set the GCC versioning toolset
+    set(BOOST_VERSIONING_TOOLSET_TAG "-gcc${BOOST_VERSIONING_GCC_VERSION}")
   endif(MSVC60)
-endmacro(boost_detect_toolset)
+endif (NOT BOOST_VERSIONING_TOOLSET_TAG)
 
 # Determine whether we should use library versioning by default
-boost_detect_toolset(FALSE)
 if(BOOST_VERSIONING_TOOLSET_TAG)
   set(USE_VERSIONING_BY_DEFAULT ON)
 else(BOOST_VERSIONING_TOOLSET_TAG)
@@ -72,62 +62,13 @@
   # Set BOOST_VERSIONING_TOOLSET_TAG to the string that describes the
   # Boost.Build toolset. This is used as part of the versioned library
   # name.
-  boost_detect_toolset(TRUE)
   if(NOT BOOST_VERSIONING_TOOLSET_TAG)
     message("Unable to determine compiler toolset. Library versioning cannot be used")
     set(USE_VERSIONING OFF CACHE BOOL 
       "Use versioned library names, e.g., boost_filesystem-gcc41-1_34" FORCE)
     set(BOOST_LIBRARY_VERSION_STRING "")
     set(BOOST_LIBRARY_VERSION_STRING_DEBUG "")
-  else(NOT BOOST_VERSIONING_TOOLSET_TAG)
-    # Multithreading tag
-    if(ENABLE_THREADING)
-      set(BOOST_LIBRARY_MT_TAG "-mt")
-    elseif(ENABLE_THREADING)
-      set(BOOST_LIBRARY_MT_TAG "")
-    endif(ENABLE_THREADING)
-    
-    # When determining the ABI tag, we need to differentiate between
-    # what comes before the debug tag ('d') and what comes after,
-    # because we can't detect at this point whether we're going to build
-    # debug or not.
-    set(BOOST_VERSIONING_ABI_TAG_PREFIX "")
-    set(BOOST_VERSIONING_ABI_TAG_SUFFIX "")
-    
-    # Determine the ABI tag for versioning
-    # TODO: Linking statically to C++ standard library
-    # TODO: Using debug versions of the standard/runtime support libs
-    # TODO: using debug build of Python
-    # This is where the debug tag lives. Switch from PREFIX to SUFFIX
-    # TODO: STLport rather than default library
-    # TODO: STLport's deprecated iostreams
-    
-    set(BOOST_VERSIONING_ABI_TAG_DEBUG 
-      "-${BOOST_VERSIONING_ABI_TAG_PREFIX}d${BOOST_VERSIONING_ABI_TAG_SUFFIX}")
-    if(BOOST_VERSIONING_ABI_TAG_PREFIX OR BOOST_VERSIONING_ABI_TAG_SUFFIX)
-      set(BOOST_VERSIONING_ABI_TAG 
-        "-${BOOST_VERSIONING_ABI_TAG_PREFIX}${BOOST_VERSIONING_ABI_TAG_SUFFIX}")
-    else(BOOST_VERSIONING_ABI_TAG_PREFIX OR BOOST_VERSIONING_ABI_TAG_SUFFIX)
-      set(BOOST_VERSIONING_ABI_TAG "")
-    endif(BOOST_VERSIONING_ABI_TAG_PREFIX OR BOOST_VERSIONING_ABI_TAG_SUFFIX)
-    
-    # Determine the Boost version number for versioning
-    if(BOOST_VERSION_SUBMINOR GREATER 0)
-      set(BOOST_VERSIONING_VERSION 
-        "${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}_${BOOST_VERSION_SUBMINOR}")
-    else(BOOST_VERSION_SUBMINOR GREATER 0)
-      set(BOOST_VERSIONING_VERSION 
-        "${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}")
-    endif(BOOST_VERSION_SUBMINOR GREATER 0)
-    
-    set(BOOST_LIBRARY_VERSION_STRING
-      "${BOOST_VERSIONING_TOOLSET_TAG}${BOOST_LIBRARY_MT_TAG}${BOOST_VERSIONING_ABI_TAG}-${BOOST_VERSIONING_VERSION}")
-    set(BOOST_LIBRARY_VERSION_STRING_DEBUG
-      "${BOOST_VERSIONING_TOOLSET_TAG}${BOOST_LIBRARY_MT_TAG}${BOOST_VERSIONING_ABI_TAG_DEBUG}-${BOOST_VERSIONING_VERSION}")
   endif(NOT BOOST_VERSIONING_TOOLSET_TAG)
-else(USE_VERSIONING)
-  set(BOOST_LIBRARY_VERSION_STRING "")
-  set(BOOST_LIBRARY_VERSION_STRING_DEBUG "")
 endif(USE_VERSIONING)
 
 
@@ -199,72 +140,231 @@
   set_target_properties(${target} PROPERTIES ${property} "${oldvalue} ${pushvalue}")
 endmacro(push_back_target_property target property pushvalue)
 
-macro(boost_library)
-  parse_arguments(THIS_LIB
-    "DEPENDS;LIBRARIES;STATIC_COMPILE_FLAGS;SHARED_COMPILE_FLAGS"
-    "NO_STATIC;NO_SHARED;STATIC_TAG"
-    ${ARGN}
-    )
-  CAR(libname ${THIS_LIB_DEFAULT_ARGS})
-  CDR(sources ${THIS_LIB_DEFAULT_ARGS})
+macro(boost_library_variant_target_name)
+  set(VARIANT_TARGET_NAME "")
+  set(VARIANT_VERSIONED_NAME "")
+
+  if (USE_VERSIONING)
+    # If we're using versioning for the names of our generated
+    # libraries, detect the full toolset name.
+    set(VARIANT_VERSIONED_NAME "${BOOST_VERSIONING_TOOLSET_TAG}")
+  endif (USE_VERSIONING)
+
+  # 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 (USE_VERSIONING)
+      # If we're creating versioned names, tack on "-mt"
+      set(VARIANT_VERSIONED_NAME "${VARIANT_VERSIONED_NAME}-mt")
+    endif (USE_VERSIONING)
+  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)
+
+  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")
+
+    if (USE_VERSIONING)
+      set(VARIANT_ABI_TAG "${VARIANT_ABI_TAG}d")
+    endif (USE_VERSIONING)
+  endif (variant_is_debug)
+
+  if (USE_VERSIONING)
+    # 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)
+  endif (USE_VERSIONING)
+endmacro(boost_library_variant_target_name)
 
-  ADD_CUSTOM_TARGET(${libname})
+macro(boost_library_variant LIBNAME)
+  set(THIS_VARIANT_COMPILE_FLAGS "${THIS_LIB_COMPILE_FLAGS}")
+  set(THIS_VARIANT_LINK_FLAGS "${THIS_LIB_COMPILE_FLAGS}")
+
+  # 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}")
+    set(THIS_VARIANT_LINK_FLAGS "${THIS_VARIANT_LINK_FLAGS} ${THIS_LIB_${ARG}_LINK_FLAGS}")
+  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})
 
-  if(NOT "${THIS_LIB_NO_STATIC}" STREQUAL "TRUE")
-    # If the STATIC_TAG option was provided, we append "-s" to the end
-    # of the target's name, so that it does not conflict with the
-    # dynamic 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)
-
-	if(WIN32 AND NOT CYGWIN)
-	  set(LIBPREFIX "lib")
-	else(WIN32 AND NOT CYGWIN)
-	  set(LIBPREFIX "")
-	endif(WIN32 AND NOT CYGWIN)
-	
-    add_library("${libname}-static" STATIC ${sources})
-    set_target_properties("${libname}-static" 
-      # notice that the static ones have -static added to the lib name.
-      # this is to accomodate those who insist on linking to the
-      # static varieties even when dynamics are available.
-      PROPERTIES 
-      OUTPUT_NAME "${LIBPREFIX}${libname}${BOOST_LIBRARY_VERSION_STRING}${THIS_LIB_STATIC_TAG}"
-      DEBUG_OUTPUT_NAME "${libname}${BOOST_LIBRARY_VERSION_STRING_DEBUG}${THIS_LIB_STATIC_TAG}"
-      RELWITHDEBINFO_OUTPUT_NAME "${libname}${BOOST_LIBRARY_VERSION_STRING_DEBUG}${THIS_LIB_STATIC_TAG}"
-      CLEAN_DIRECT_OUTPUT 1
-      COMPILE_FLAGS "${THIS_LIB_STATIC_COMPILE_FLAGS}"
-      )
+      # 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}"
+        )
+    else (THIS_LIB_IS_STATIC)
+      # Add the library itself
+      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}"
+        SOVERSION "${BOOST_VERSION}"
+        )
+    endif (THIS_LIB_IS_STATIC)
       
-    add_dependencies(${libname} "${libname}-static")
-    target_link_libraries("${libname}-static" ${THIS_LIB_LIBRARIES})
+    # 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_LIB_LIBRARIES})
     foreach(dependency ${THIS_LIB_DEPENDS})
-      target_link_libraries("${libname}-static" "${dependency}-static")
+      target_link_libraries(${VARIANT_LIBNAME} "${dependency}${VARIANT_TARGET_NAME}")
     endforeach(dependency "${THIS_LIB_DEPENDS}")
 
-    install(TARGETS "${libname}-static" DESTINATION lib)
-  endif(NOT "${THIS_LIB_NO_STATIC}" STREQUAL "TRUE")
+    # Installation of this library variant
+    install(TARGETS ${VARIANT_LIBNAME} DESTINATION lib)
+  endif (THIS_VARIANT_OKAY)
+endmacro(boost_library_variant)
+
+# Doug: None of this actually works, but it looks neat! I'll take
+# another shot at this another time, without the attempt at macro
+# recursion.
+macro(boost_library_enumerate_variants LIBNAME FEATURE_OPTIONS_IN)
+  message(STATUS "Feature options: ${FEATURE_OPTIONS}")
+
+  # TODO: This is a kludge that determines when ARGN is
+  # non-empty. There must be a better way!
+  set(MORE_FEATURE_OPTIONS FALSE)
+  foreach(ARG ${ARGN})
+    set(MORE_FEATURE_OPTIONS TRUE)
+  endforeach(ARG ${ARGN})
+
+  # The options for a feature comes in as a colon-separated
+  # list; split that into a real list
+  string(REPLACE ":" ";" FEATURE_OPTIONS ${FEATURE_OPTIONS_IN})
+  separate_arguments(FEATURE_OPTIONS)
+    
+  foreach (FEATURE ${FEATURE_OPTIONS})
+    message(STATUS "Feature: ${FEATURE}")
+    if (MORE_FEATURE_OPTIONS)
+      message("Recursing...")
+      # Add this feature to the variant
+      list(APPEND CURRENT_VARIANT_FEATURES ${FEATURE})
+      
+      # Recurse to produce the full sets of features for each
+      # variant
+      boost_library_enumerate_variants(${LIBNAME} ${ARGN})
+      
+      # Remove this feature from the variant
+      list(REMOVE_ITEM CURRENT_VARIANT_FEATURES ${FEATURE})
+    elseif (MORE_FEATURE_OPTIONS)
+      # Produce the library variant
+      boost_library_variant(${LIBNAME} ${CURRENT_VARIANT_FEATURES} ${FEATURE})
+    endif (MORE_FEATURE_OPTIONS)
+  endforeach (FEATURE ${FEATURE_OPTIONS})
+endmacro(boost_library_enumerate_variants)
+
+macro(boost_library)
+  parse_arguments(THIS_LIB
+    "DEPENDS;LIBRARIES;STATIC_COMPILE_FLAGS;SHARED_COMPILE_FLAGS;DEBUG_COMPILE_FLAGS;RELEASE_COMPILE_FLAGS"
+    "NO_STATIC;NO_SHARED;STATIC_TAG"
+    ${ARGN}
+    )
+  car(LIBNAME ${THIS_LIB_DEFAULT_ARGS})
+  cdr(THIS_LIB_SOURCES ${THIS_LIB_DEFAULT_ARGS})
 
-  if(NOT "${THIS_LIB_NO_SHARED}" STREQUAL "TRUE") 
-    add_library("${libname}-shared" SHARED ${sources})
-    set_target_properties("${libname}-shared" 
-      PROPERTIES 
-      OUTPUT_NAME "${libname}${BOOST_LIBRARY_VERSION_STRING}"
-      DEBUG_OUTPUT_NAME "${libname}${BOOST_LIBRARY_VERSION_STRING_DEBUG}"
-      RELWITHDEBINFO_OUTPUT_NAME "${libname}${BOOST_LIBRARY_VERSION_STRING_DEBUG}"
-      CLEAN_DIRECT_OUTPUT 1
-      COMPILE_FLAGS "${THIS_LIB_SHARED_COMPILE_FLAGS}"
-      SOVERSION "${BOOST_VERSION}"
-      )
-    add_dependencies(${libname} "${libname}-shared")
-    target_link_libraries("${libname}-shared" ${THIS_LIB_LIBRARIES})
-    foreach(dependency ${THIS_LIB_DEPENDS})
-      target_link_libraries("${libname}-shared" "${dependency}-shared")
-    endforeach(dependency ${THIS_LIB_DEPENDS})
-    install(TARGETS "${libname}-shared" DESTINATION lib)
-  endif(NOT "${THIS_LIB_NO_SHARED}" STREQUAL "TRUE")
+  add_custom_target(${LIBNAME})
+
+# See about: this doesn't work
+#  set(DEFAULT_VARIANT_OPTIONS)
+#  set(DEFAULT_VARIANT_OPTIONS ${DEFAULT_VARIANT_OPTIONS} "STATIC:SHARED")
+#  set(DEFAULT_VARIANT_OPTIONS ${DEFAULT_VARIANT_OPTIONS} "DEBUG:RELEASE")
+#  set(DEFAULT_VARIANT_OPTIONS ${DEFAULT_VARIANT_OPTIONS} "MULTI_THREADED:SINGLE_THREADED")
+
+#  set(CURRENT_VARIANT_FEATURES)
+#  boost_library_enumerate_variants (${LIBNAME} ${DEFAULT_VARIANT_OPTIONS})
+  boost_library_variant(${LIBNAME} STATIC DEBUG)
+  boost_library_variant(${LIBNAME} STATIC RELEASE)
+  boost_library_variant(${LIBNAME} SHARED DEBUG)
+  boost_library_variant(${LIBNAME} SHARED RELEASE)
 endmacro(boost_library)
 
Modified: 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	(original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/boost.cmake	2007-06-01 09:25:31 EDT (Fri, 01 Jun 2007)
@@ -10,18 +10,3 @@
 include(boost-core)
 include(boost-testing)
 
-OPTION(DEBUG "Print lots of gnasty trace output from makefile generation stage" OFF)
-macro(TRACE)
-  if (DEBUG)
-    MESSAGE("~~ " ${ARGN})
-  endif (DEBUG)
-endmacro(TRACE)
-
-macro(ASSERT value)
-  if (NOT ${value})
-    MESSAGE("Assertion failed: ${value} = ${${value}}")
-    MESSAGE(FATAL_ERROR ${ARGN})
-  endif (NOT ${value})
-endmacro(ASSERT value)
-    
-