Boost logo

Boost-Commit :

From: troy_at_[hidden]
Date: 2007-05-17 11:42:25


Author: troy
Date: 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
New Revision: 4095
URL: http://svn.boost.org/trac/boost/changeset/4095

Log:
tools/build/CMake/testing/* contains a projects a,b,c,d,e arranged
like this:

          A
        / \
       B C
        \ /
          D E

for checking propagation of usage requirements, dependency calculation, etc.

basic "usage requirements" works thought the full diamond above isn't
fully peppered with asserts yet. You can set the following "properties"
on libs:

COMPILE_FLAGS
STICKY_COMPILE_FLAGS
SHARED_COMPILE_FLAGS
STICKY_SHARED_COMPILE_FLAGS
STATIC_COMPILE_FLAGS
STICKY_STATIC_COMPILE_FLAGS

The thinking is that toolset and threading will be "one scope up",
that this level can remain ignorant.

there's a variable RUN_SELFTESTS in boost.cmake that turns
off building of boost and turns on building of the
testing stuff.

Added:
   sandbox/troy/boost_1_34_0/tools/build/CMake/boost.cmake
   sandbox/troy/boost_1_34_0/tools/build/CMake/filter_out.cmake
   sandbox/troy/boost_1_34_0/tools/build/CMake/no_dotfile_glob.cmake
   sandbox/troy/boost_1_34_0/tools/build/CMake/sort.cmake
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/CMakeLists.txt
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/CMakeLists.txt
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/lib.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/test_shared.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/test_static.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/CMakeLists.txt
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/ashared_bstatic.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/astatic_bshared.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/foo.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/lib.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/test_shared.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/test_static.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/c/
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/c/CMakeLists.txt
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/c/lib.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/d/
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/d/CMakeLists.txt
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/d/lib.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/e/
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/e/CMakeLists.txt
   sandbox/troy/boost_1_34_0/tools/build/CMake/testing/e/lib.cpp
   sandbox/troy/boost_1_34_0/tools/build/CMake/unique.cmake
Text files modified:
   sandbox/troy/boost_1_34_0/CMakeLists.txt | 12 ++++----
   sandbox/troy/boost_1_34_0/libs/CMakeLists.txt | 2
   sandbox/troy/boost_1_34_0/tools/build/CMake/boost-core.cmake | 57 +++++++++++++++++++++++++++++++++++++--
   sandbox/troy/boost_1_34_0/tools/build/CMake/boost-testing.cmake | 8 +++++
   4 files changed, 68 insertions(+), 11 deletions(-)

Modified: sandbox/troy/boost_1_34_0/CMakeLists.txt
==============================================================================
--- sandbox/troy/boost_1_34_0/CMakeLists.txt (original)
+++ sandbox/troy/boost_1_34_0/CMakeLists.txt 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -29,11 +29,7 @@
 # Make it easy to find Boost-specific CMake modules
 list(APPEND CMAKE_MODULE_PATH ${Boost_SOURCE_DIR}/tools/build/CMake)
 
-include(list_contains)
-include(parse_arguments)
-# Testing module
-include(boost-core)
-include(boost-testing)
+include(boost)
 
 ##########################################################################
 # Boost installation #
@@ -74,4 +70,8 @@
 ##########################################################################
 
 # Subdirectories of Boost
-add_subdirectory(libs)
+if (RUN_SELFTESTS)
+ add_subdirectory(tools/build/CMake/testing)
+else (RUN_SELFTESTS)
+ add_subdirectory(libs)
+endif(RUN_SELFTESTS)
\ No newline at end of file

Modified: sandbox/troy/boost_1_34_0/libs/CMakeLists.txt
==============================================================================
--- sandbox/troy/boost_1_34_0/libs/CMakeLists.txt (original)
+++ sandbox/troy/boost_1_34_0/libs/CMakeLists.txt 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -5,7 +5,7 @@
 # return a list of directories that we should add_subdirectory()
 macro(BOOST_COLLECT_SUBPROJECT_DIRECTORY_NAMES varname)
   file(GLOB BOOST_LIBRARY_CMAKE_FILES
- RELATIVE "${Boost_SOURCE_DIR}/libs" "*/CMakeLists.txt")
+ RELATIVE "${CMAKE_SOURCE_DIR}/libs" "*/CMakeLists.txt")
   MESSAGE(STATUS "Scanning subdirectories:")
   foreach(BOOST_LIB_CMAKE_FILE ${BOOST_LIBRARY_CMAKE_FILES})
     get_filename_component(BOOST_LIB_DIR ${BOOST_LIB_CMAKE_FILE} PATH)

Modified: sandbox/troy/boost_1_34_0/tools/build/CMake/boost-core.cmake
==============================================================================
--- sandbox/troy/boost_1_34_0/tools/build/CMake/boost-core.cmake (original)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/boost-core.cmake 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -12,6 +12,20 @@
   set(${varname} ${${varname}} ${ARGN})
 endmacro(append varname)
 
+IF(0)
+macro(set_usage_requirements target)
+ parse_arguments(USAGE_REQS
+ "STATIC;SHARED"
+ ""
+ ${ARGN}
+ )
+ set_target_properties(target
+ PROPERTIES
+ STATIC_USAGE_REQS "${USAGE_REQS_STATIC}"
+ SHARED_USAGE_REQS "${USAGE_REQS_SHARED}"
+ )
+endmacro(set_usage_requirements target)
+ENDIF(0)
 # Defines a Boost library subproject (e.g., for Boost.Python). Use as:
 #
 # boost_library_subproject(libname, subdir1, subdir2, ...)
@@ -42,9 +56,35 @@
   endforeach(SUBDIR ${THIS_SUBPROJECT_SRCDIRS} ${THIS_SUBPROJECT_TESTDIRS})
 endmacro(boost_library_subproject)
 
+macro(push_back_target_property target property pushvalue)
+ get_target_property(oldvalue ${target} ${property})
+ if(NOT oldvalue)
+ set(oldvalue "")
+ endif(NOT oldvalue)
+ set_target_properties(${target} PROPERTIES ${property} "${oldvalue} ${pushvalue}")
+endmacro(push_back_target_property target property pushvalue)
+
+macro(propagate_property)
+ trace("args: ${ARGN}")
+ parse_arguments(_
+ "FROM_TARGET;TO_TARGET;FROM_PROPNAME;TO_PROPNAME"
+ ""
+ ${ARGN}
+ )
+ trace("propagate ${__FROM_TARGET}:${__FROM_PROPNAME} -> ${__TO_TARGET}:${__TO_PROPNAME} [${props_}]")
+ assert(__FROM_TARGET)
+ assert(__FROM_PROPNAME)
+ assert(__TO_TARGET)
+ get_target_property(props_ ${__FROM_TARGET} ${__FROM_PROPNAME})
+ trace("::: ${props_}")
+ if (props_)
+ push_back_target_property(${__TO_TARGET} ${__TO_PROPNAME} ${props_})
+ endif(props_)
+endmacro(propagate_property)
+
 macro(boost_library)
   parse_arguments(THIS_LIB
- "DEPENDS;LIBRARIES;COMPILE_FLAGS;STATIC_COMPILE_FLAGS;SHARED_COMPILE_FLAGS"
+ "DEPENDS;LIBRARIES;COMPILE_FLAGS;STICKY_COMPILE_FLAGS;STATIC_COMPILE_FLAGS;SHARED_COMPILE_FLAGS;STICKY_STATIC_COMPILE_FLAGS;STICKY_STATIC_LINK_FLAGS;STICKY_SHARED_COMPILE_FLAGS;STICKY_SHARED_LINK_FLAGS"
     "NO_STATIC;NO_SHARED"
     ${ARGN}
     )
@@ -57,11 +97,17 @@
       # 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 "${libname}-static"
+ PROPERTIES
+ OUTPUT_NAME "${libname}-static"
       CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "${THIS_LIB_COMPILE_FLAGS} ${THIS_LIB_STATIC_COMPILE_FLAGS}")
+ COMPILE_FLAGS "${THIS_LIB_COMPILE_FLAGS} ${THIS_LIB_STICKY_COMPILE_FLAGS} ${THIS_LIB_STATIC_COMPILE_FLAGS} ${THIS_LIB_STICKY_STATIC_COMPILE_FLAGS}"
+ STICKY_COMPILE_FLAGS "${THIS_LIB_STICKY_COMPILE_FLAGS} ${THIS_LIB_STICKY_STATIC_COMPILE_FLAGS}"
+ STICKY_LINK_FLAGS "${THIS_LIB_STICKY_STATIC_LINK_FLAGS}"
+ )
+ MESSAGE("sticky statics(${libname}): ${THIS_LIB_STICKY_STATIC_COMPILE_FLAGS}")
     foreach(dependency ${THIS_LIB_DEPENDS})
       target_link_libraries("${libname}-static" "${dependency}-static")
+# propagate_property(TARGET ${libname}-static DEPENDENCY ${dependency}-static DEP_PROPNAME STICKY_STATIC_COMPILE_FLAGS TARG_PROPNAME STICKY_COMPILE_FLAGS)
     endforeach(dependency "${THIS_LIB_DEPENDS}")
 
     install(TARGETS "${libname}-static" DESTINATION lib)
@@ -72,7 +118,10 @@
     set_target_properties("${libname}-shared"
       PROPERTIES OUTPUT_NAME "${libname}"
       CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "${THIS_LIB_COMPILE_FLAGS} ${THIS_LIB_SHARED_COMPILE_FLAGS}")
+ COMPILE_FLAGS "${THIS_LIB_COMPILE_FLAGS} ${THIS_LIB_STICKY_COMPILE_FLAGS} ${THIS_LIB_SHARED_COMPILE_FLAGS} ${THIS_LIB_STICKY_SHARED_COMPILE_FLAGS}"
+ STICKY_COMPILE_FLAGS "${THIS_LIB_STICKY_COMPILE_FLAGS} ${THIS_LIB_STICKY_SHARED_COMPILE_FLAGS}"
+ STICKY_LINK_FLAGS "${THIS_LIB_STICKY_SHARED_LINK_FLAGS}"
+ )
     foreach(dependency ${THIS_LIB_DEPENDS})
       target_link_libraries("${libname}-shared" "${dependency}-shared")
     endforeach(dependency ${THIS_LIB_DEPENDS})

Modified: sandbox/troy/boost_1_34_0/tools/build/CMake/boost-testing.cmake
==============================================================================
--- sandbox/troy/boost_1_34_0/tools/build/CMake/boost-testing.cmake (original)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/boost-testing.cmake 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -80,6 +80,14 @@
       )
     target_link_libraries(${testname} ${BOOST_TEST_DEPENDS})
     target_link_libraries(${testname} ${BOOST_TEST_LIBRARIES})
+ foreach(_depend ${BOOST_TEST_DEPENDS})
+ trace("propagate from ${BOOST_TEST_DEPENDS}")
+ propagate_property(FROM_TARGET ${_depend}
+ FROM_PROPNAME STICKY_COMPILE_FLAGS
+ TO_TARGET ${testname}
+ TO_PROPNAME COMPILE_FLAGS
+ )
+ endforeach(_depend ${BOOST_TEST_DEPENDS})
     add_test("${PROJECT_NAME}::${testname}" ${EXECUTABLE_OUTPUT_PATH}/${testname})
   endif(BOOST_TEST_OKAY)
 endmacro(boost_test_run)

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/boost.cmake
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/boost.cmake 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,35 @@
+#
+# organization point for includes
+#
+include(list_contains)
+include(parse_arguments)
+
+include(boost-core)
+include(boost-testing)
+
+set(DEBUG TRUE)
+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)
+
+SET(RUN_SELFTESTS FALSE)
+
+if(RUN_SELFTESTS)
+ trace("Start selftests")
+ file (GLOB testfiles_ "${CMAKE_SOURCE_DIR}/tools/build/CMake/tests/*.cmake")
+ foreach(file_ ${testfiles_})
+ trace("### ${file_}")
+ include(${file_})
+ endforeach(file_ ${testfiles_})
+ trace("End selftests")
+endif(RUN_SELFTESTS)
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/filter_out.cmake
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/filter_out.cmake 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,76 @@
+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)
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/no_dotfile_glob.cmake
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/no_dotfile_glob.cmake 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,35 @@
+# 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)

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/sort.cmake
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/sort.cmake 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,27 @@
+################################################################################
+# 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)
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/CMakeLists.txt 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,15 @@
+# libraries arranged like this:
+#
+# A
+# / \
+# B C
+# \ /
+# D E
+#
+# for checking propagation of usage requirements, dependency calculation, etc.
+#
+add_subdirectory(a)
+add_subdirectory(b)
+add_subdirectory(c)
+add_subdirectory(d)
+add_subdirectory(e)
\ No newline at end of file

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/CMakeLists.txt 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,16 @@
+boost_library_subproject(
+ A
+)
+
+boost_library(a
+ lib.cpp
+ COMPILE_FLAGS -DA_COMPILE_FLAGS
+ STICKY_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -DA_STICKY_COMPILE_FLAGS"
+ STATIC_COMPILE_FLAGS "-DA_STATIC_COMPILE_FLAGS -DLINKTYPE=static"
+ STICKY_STATIC_COMPILE_FLAGS -DA_STICKY_STATIC_COMPILE_FLAGS
+ SHARED_COMPILE_FLAGS "-DA_SHARED_COMPILE_FLAGS -DLINKTYPE=shared"
+ STICKY_SHARED_COMPILE_FLAGS -DA_STICKY_SHARED_COMPILE_FLAGS
+)
+
+boost_test_run(test_shared DEPENDS a-shared)
+boost_test_run(test_static DEPENDS a-static)

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/lib.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/lib.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,19 @@
+#include <iostream>
+#include <string>
+#include <boost/preprocessor/stringize.hpp>
+#ifndef A_COMPILE_FLAGS
+#error A_COMPILE_FLAGS
+#endif
+#ifndef A_STICKY_COMPILE_FLAGS
+#error A_STICKY_COMPILE_FLAGS
+#endif
+
+// dont check (sticky)static/shared here, this gets compiled twice.
+// tests check that things worked right via LINKTYPE
+
+std::string a_linktype() { return BOOST_PP_STRINGIZE(LINKTYPE); }
+
+
+
+
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/test_shared.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/test_shared.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,7 @@
+#include "a.hpp"
+#include <cassert>
+int main(int argc, char**argv)
+{
+ assert(a_linktype() == "shared");
+}
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/test_static.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/a/test_static.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,15 @@
+#include "a.hpp"
+#include <cassert>
+
+#ifndef A_STICKY_COMPILE_FLAGS
+#error A_STICKY_COMPILE_FLAGS
+#endif
+#ifndef A_STICKY_STATIC_COMPILE_FLAGS
+#error A_STICKY_STATIC_COMPILE_FLAGS
+#endif
+
+int main(int argc, char**argv)
+{
+ assert(a_linktype() == "static");
+}
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/CMakeLists.txt 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,19 @@
+boost_library_subproject(
+ B
+)
+
+boost_library(b
+ lib.cpp
+ COMPILE_FLAGS -DB_COMPILE_FLAGS
+ STICKY_COMPILE_FLAGS -DB_STICKY_COMPILE_FLAGS
+ STATIC_COMPILE_FLAGS -DLINKTYPE=static
+ STICKY_STATIC_COMPILE_FLAGS -DB_STICKY_STATIC_COMPILE_FLAGS
+ SHARED_COMPILE_FLAGS -DLINKTYPE=shared
+ STICKY_SHARED_COMPILE_FLAGS -DB_STICKY_SHARED_COMPILE_FLAGS
+)
+
+boost_test_run(test_shared DEPENDS b-shared a-shared)
+boost_test_run(test_static DEPENDS b-static a-static)
+
+boost_test_run(astatic_bshared DEPENDS a-static b-shared)
+boost_test_run(ashared_bstatic DEPENDS a-shared b-static)

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/ashared_bstatic.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/ashared_bstatic.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,24 @@
+#ifndef A_STICKY_COMPILE_FLAGS
+#error A_STICKY_COMPILE_FLAGS
+#endif
+#ifndef A_STICKY_SHARED_COMPILE_FLAGS
+#error A_STICKY_SHARED_COMPILE_FLAGS
+#endif
+
+#ifndef B_STICKY_COMPILE_FLAGS
+#error B_STICKY_COMPILE_FLAGS
+#endif
+#ifndef B_STICKY_STATIC_COMPILE_FLAGS
+#error B_STICKY_STATIC_COMPILE_FLAGS
+#endif
+
+#include "a.hpp"
+#include "b.hpp"
+#include <cassert>
+
+int main(int argc, char**argv)
+{
+ assert(a_linktype() == "shared");
+ assert(b_linktype() == "static");
+}
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/astatic_bshared.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/astatic_bshared.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,26 @@
+#ifndef A_STICKY_COMPILE_FLAGS
+#error A_STICKY_COMPILE_FLAGS
+#endif
+
+#ifndef A_STICKY_STATIC_COMPILE_FLAGS
+#error A_STICKY_STATIC_COMPILE_FLAGS
+#endif
+
+#ifndef B_STICKY_COMPILE_FLAGS
+#error static flags not here
+#endif
+
+#ifndef B_STICKY_SHARED_COMPILE_FLAGS
+#error static flags not here
+#endif
+
+#include "a.hpp"
+#include "b.hpp"
+#include <cassert>
+
+int main(int argc, char**argv)
+{
+ assert(b_linktype() == "shared");
+ assert(a_linktype() == "static");
+}
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/foo.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/foo.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,9 @@
+#include <iostream>
+
+int bg(int i);
+
+int bf(int i) { bg(i); }
+int bg(int i) { bf(i); }
+
+
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/lib.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/lib.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,13 @@
+#include <iostream>
+#include <string>
+#include <boost/preprocessor/stringize.hpp>
+
+#ifndef B_COMPILE_FLAGS
+#error B_COMPILE_FLAGS
+#endif
+#ifndef B_STICKY_COMPILE_FLAGS
+#error B_STICKY_COMPILE_FLAGS
+#endif
+
+std::string b_linktype() { return BOOST_PP_STRINGIZE(LINKTYPE); }
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/test_shared.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/test_shared.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,24 @@
+#ifndef A_STICKY_COMPILE_FLAGS
+#error A_STICKY_COMPILE_FLAGS
+#endif
+#ifndef A_STICKY_SHARED_COMPILE_FLAGS
+#error A_STICKY_SHARED_COMPILE_FLAGS
+#endif
+
+#ifndef B_STICKY_COMPILE_FLAGS
+#error B_STICKY_COMPILE_FLAGS
+#endif
+#ifndef B_STICKY_SHARED_COMPILE_FLAGS
+#error B_STICKY_SHARED_COMPILE_FLAGS
+#endif
+
+
+#include "a.hpp"
+#include "b.hpp"
+#include <cassert>
+int main(int argc, char**argv)
+{
+ assert(b_linktype() == "shared");
+ assert(a_linktype() == "shared");
+}
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/test_static.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/b/test_static.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,24 @@
+#ifndef A_STICKY_COMPILE_FLAGS
+#error A_STICKY_COMPILE_FLAGS
+#endif
+#ifndef A_STICKY_STATIC_COMPILE_FLAGS
+#error A_STICKY_STATIC_COMPILE_FLAGS
+#endif
+
+#ifndef B_STICKY_COMPILE_FLAGS
+#error B_STICKY_COMPILE_FLAGS
+#endif
+#ifndef B_STICKY_STATIC_COMPILE_FLAGS
+#error B_STICKY_STATIC_COMPILE_FLAGS
+#endif
+
+#include "a.hpp"
+#include "b.hpp"
+#include <cassert>
+
+int main(int argc, char**argv)
+{
+ assert(b_linktype() == "static");
+ assert(a_linktype() == "static");
+}
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/c/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/c/CMakeLists.txt 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,7 @@
+boost_library_subproject(
+ C
+)
+
+boost_library(boost_c lib.cpp)
+
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/c/lib.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/c/lib.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,9 @@
+#include <iostream>
+#include <string>
+
+std::string c() { return "c"; }
+
+
+
+
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/d/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/d/CMakeLists.txt 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,6 @@
+boost_library_subproject(
+ D
+)
+boost_library(boost_d lib.cpp)
+
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/d/lib.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/d/lib.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,9 @@
+#include <iostream>
+#include <string>
+
+std::string d() { return "d"; }
+
+
+
+
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/e/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/e/CMakeLists.txt 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,6 @@
+boost_library_subproject(
+ E
+)
+boost_library(boost_e lib.cpp)
+
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/testing/e/lib.cpp
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/testing/e/lib.cpp 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,9 @@
+#include <iostream>
+#include <string>
+
+std::string e() { return "e"; }
+
+
+
+
+

Added: sandbox/troy/boost_1_34_0/tools/build/CMake/unique.cmake
==============================================================================
--- (empty file)
+++ sandbox/troy/boost_1_34_0/tools/build/CMake/unique.cmake 2007-05-17 11:42:22 EDT (Thu, 17 May 2007)
@@ -0,0 +1,11 @@
+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