Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53147 - in branches/release: libs/asio/test libs/asio/test/local tools/build/CMake tools/build/CMake/LinkTest
From: troy_at_[hidden]
Date: 2009-05-20 20:31:37


Author: troy
Date: 2009-05-20 20:31:35 EDT (Wed, 20 May 2009)
New Revision: 53147
URL: http://svn.boost.org/trac/boost/changeset/53147

Log:
tune up link tests in general, asio tests specifically
Text files modified:
   branches/release/libs/asio/test/CMakeLists.txt | 1 +
   branches/release/libs/asio/test/local/CMakeLists.txt | 10 +++++-----
   branches/release/tools/build/CMake/BoostCore.cmake | 4 +++-
   branches/release/tools/build/CMake/BoostTesting.cmake | 23 +++++++++++++----------
   branches/release/tools/build/CMake/LinkTest/CMakeLists.txt | 12 ++++++++++--
   5 files changed, 32 insertions(+), 18 deletions(-)

Modified: branches/release/libs/asio/test/CMakeLists.txt
==============================================================================
--- branches/release/libs/asio/test/CMakeLists.txt (original)
+++ branches/release/libs/asio/test/CMakeLists.txt 2009-05-20 20:31:35 EDT (Wed, 20 May 2009)
@@ -3,6 +3,7 @@
 set (dep_libs "")
 
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+ set(dep_libs "pthread")
     set(os_defines "-D_XOPEN_SOURCE=600 -D_GNU_SOURCE=1")
 endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
 

Modified: branches/release/libs/asio/test/local/CMakeLists.txt
==============================================================================
--- branches/release/libs/asio/test/local/CMakeLists.txt (original)
+++ branches/release/libs/asio/test/local/CMakeLists.txt 2009-05-20 20:31:35 EDT (Wed, 20 May 2009)
@@ -1,10 +1,10 @@
 foreach(test
- local_basic_endpoint
- local_connect_pair
- local_datagram_protocol
- local_stream_protocol
+ basic_endpoint
+ connect_pair
+ datagram_protocol
+ stream_protocol
     )
- boost_test_link(${test})
+ asio_test_link(${test})
 endforeach()
 
 

Modified: branches/release/tools/build/CMake/BoostCore.cmake
==============================================================================
--- branches/release/tools/build/CMake/BoostCore.cmake (original)
+++ branches/release/tools/build/CMake/BoostCore.cmake 2009-05-20 20:31:35 EDT (Wed, 20 May 2009)
@@ -728,7 +728,9 @@
       
     # The basic LIBNAME target depends on each of the variants
     add_dependencies(${LIBNAME} ${VARIANT_LIBNAME})
-
+
+ export(TARGETS ${VARIANT_LIBNAME} FILE ${CMAKE_BINARY_DIR}/exports/${VARIANT_LIBNAME}.cmake)
+
     # Link against whatever libraries this library depends on
     target_link_libraries(${VARIANT_LIBNAME} ${THIS_VARIANT_LINK_LIBS})
     foreach(dependency ${THIS_LIB_DEPENDS})

Modified: branches/release/tools/build/CMake/BoostTesting.cmake
==============================================================================
--- branches/release/tools/build/CMake/BoostTesting.cmake (original)
+++ branches/release/tools/build/CMake/BoostTesting.cmake 2009-05-20 20:31:35 EDT (Wed, 20 May 2009)
@@ -396,7 +396,15 @@
 #
 # boost_test_link:
 #
-# Under construction.
+#
+# Each library "exports" itself to
+# ${CMAKE_BINARY_DIR}/exports/<variantname>.cmake
+#
+# The list of 'depends' for these libraries has to match one of those
+# files, this way the export mechanism works. The generated
+# cmakelists will include() those exported .cmake files, for each
+# DEPENDS.
+#
 #
 macro(boost_test_link testname)
   boost_test_parse_args(${testname} ${ARGN} LINK)
@@ -410,15 +418,9 @@
       set(BOOST_TEST_INCLUDES "${BOOST_TEST_INCLUDES};${DIR}")
     endforeach(DIR ${BOOST_TEST_INCLUDE_DIRS})
 
- set(TARGET_LINK_LIBRARIES_LIST "")
- foreach(DEP ${BOOST_TEST_DEPENDS})
- get_target_property(THISONE_LOCATION ${DEP} LOCATION)
- list(APPEND TARGET_LINK_LIBRARIES_LIST ${THISONE_LOCATION})
- endforeach()
-
-
     add_test(${BOOST_TEST_TESTNAME}
       ${CMAKE_CTEST_COMMAND}
+ -VV
       --build-and-test
       ${Boost_SOURCE_DIR}/tools/build/CMake/LinkTest
       ${Boost_BINARY_DIR}/tools/build/CMake/LinkTest
@@ -426,11 +428,12 @@
       --build-makeprogram ${CMAKE_MAKE_PROGRAM}
       --build-project LinkTest
       --build-options
- "-DPARENT_BINARY_DIR:FILEPATH=${CMAKE_CACHEFILE_DIR}"
+ "-DBOOST_EXPORTS_DIR:FILEPATH=${CMAKE_BINARY_DIR}/exports"
       "-DSOURCE:STRING=${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_TEST_SOURCES}"
       "-DINCLUDES:STRING=${BOOST_TEST_INCLUDES}"
       "-DCOMPILE_FLAGS:STRING=${BOOST_TEST_COMPILE_FLAGS}"
- "-DLINK_LIBS:STRING=${BOOST_TEST_LINK_LIBS};${TARGET_LINK_LIBRARIES_LIST}"
+ "-DLINK_LIBS:STRING=${BOOST_TEST_LINK_LIBS}"
+ "-DDEPENDS:STRING=${BOOST_TEST_DEPENDS}"
       )
 
     set_tests_properties(${BOOST_TEST_TESTNAME}

Modified: branches/release/tools/build/CMake/LinkTest/CMakeLists.txt
==============================================================================
--- branches/release/tools/build/CMake/LinkTest/CMakeLists.txt (original)
+++ branches/release/tools/build/CMake/LinkTest/CMakeLists.txt 2009-05-20 20:31:35 EDT (Wed, 20 May 2009)
@@ -1,6 +1,11 @@
 cmake_minimum_required(VERSION 2.6)
 
-load_cache(${PARENT_BINARY_DIR})
+file(GLOB BOOST_EXPORTS "${BOOST_EXPORTS_DIR}/*.cmake")
+
+foreach(import
+ ${DEPENDS})
+ include(${BOOST_EXPORTS_DIR}/${import}.cmake)
+endforeach()
 
 project(LinkTest)
 include_directories (${INCLUDES})
@@ -8,5 +13,8 @@
 set_source_files_properties(${SOURCE}
   PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
 
+message("DEPENDS=====${DEPENDS}")
+
 target_link_libraries(link-test
- ${LINK_LIBS})
+ ${LINK_LIBS}
+ ${DEPENDS})


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