|
Boost-Commit : |
From: dgregor_at_[hidden]
Date: 2007-06-16 10:41:51
Author: dgregor
Date: 2007-06-16 10:41:50 EDT (Sat, 16 Jun 2007)
New Revision: 7075
URL: http://svn.boost.org/trac/boost/changeset/7075
Log:
Fix build bugs that were causing failures in the Python library
Text files modified:
sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt | 44 ++++++++++++++++++++++-----------------
1 files changed, 25 insertions(+), 19 deletions(-)
Modified: sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt
==============================================================================
--- sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt (original)
+++ sandbox-branches/boost-cmake/boost_1_34_0/libs/python/test/CMakeLists.txt 2007-06-16 10:41:50 EDT (Sat, 16 Jun 2007)
@@ -6,32 +6,34 @@
# Determine the Python and C++ source files for this test
if (BPL_TEST_DEFAULT_ARGS)
+ # First argument is the Python source we will run, the rest are
+ # either extra Python sources we're dependent on or C++ files from
+ # which we will build extension modules.
car(BPL_TEST_PYSOURCE ${BPL_TEST_DEFAULT_ARGS})
- set(BPL_TEST_SOURCES)
- set(BPL_TEST_DEPENDS)
cdr(BPL_TEST_DEFAULT_ARGS ${BPL_TEST_DEFAULT_ARGS})
+
+ get_filename_component(BPL_TEST_PYBASE ${BPL_TEST_PYSOURCE} NAME_WE)
foreach(SRC ${BPL_TEST_DEFAULT_ARGS})
get_filename_component(BPL_SRC_EXT ${SRC} EXT)
- if (BPL_SRC_EXT STREQUAL "py")
- set (BPL_TEST_DEPENDS ${BPL_TEST_DEPENDS} "${SRC}")
- else (BPL_SRC_EXT STREQUAL "py")
- set(BPL_TEST_SOURCES ${BPL_TEST_SOURCES} "${SRC}")
- endif (BPL_SRC_EXT STREQUAL "py")
+ if (BPL_SRC_EXT STREQUAL ".cpp")
+ # Build a Python extension module from this source file
+ get_filename_component(BPL_SRC_NAME ${SRC} NAME_WE)
+ if(BPL_TEST_PYBASE STREQUAL "${BPL_SRC_NAME}")
+ boost_python_extension(${BPL_SRC_NAME}_ext ${SRC})
+ else(BPL_TEST_PYBASE STREQUAL "${BPL_SRC_NAME}")
+ boost_python_extension(${BPL_SRC_NAME} ${SRC})
+ endif(BPL_TEST_PYBASE STREQUAL "${BPL_SRC_NAME}")
+ endif (BPL_SRC_EXT STREQUAL ".cpp")
endforeach(SRC ${BPL_TEST_DEFAULT_ARGS})
else (BPL_TEST_DEFAULT_ARGS)
set(BPL_TEST_PYSOURCE "${TESTNAME}.py")
- set(BPL_TEST_DEPENDS)
- set(BPL_TEST_SOURCES "${TESTNAME}.cpp")
- endif(BPL_TEST_DEFAULT_ARGS)
- set(BPL_TEST_PYSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/${BPL_TEST_PYSOURCE})
- # Build the Python extension module we need
- boost_python_extension(${TESTNAME}_ext ${BPL_TEST_SOURCES})
+ # Build a Python extension module from this source file
+ boost_python_extension(${TESTNAME}_ext "${TESTNAME}.cpp")
+ endif(BPL_TEST_DEFAULT_ARGS)
- # Add any extra dependencies
- if (BPL_TEST_DEPENDS)
- add_dependencies(${TESTNAME}_ext ${BPL_TEST_DEPENDS})
- endif (BPL_TEST_DEPENDS)
+ # We'll need the full patch to run the Python test
+ set(BPL_TEST_PYSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/${BPL_TEST_PYSOURCE})
# Run the test itself
file(TO_NATIVE_PATH ${LIBRARY_OUTPUT_PATH} PYTHONPATH)
@@ -87,7 +89,8 @@
bpl_test(const_argument)
bpl_test(keywords keywords_test.py keywords.cpp)
-bpl_test(builtin_converters test_builtin_converters.py test_builtin_converters.cpp)
+boost_python_extension(builtin_converters_ext test_builtin_converters.cpp)
+bpl_test(builtin_converters test_builtin_converters.py builtin_converters_ext)
bpl_test(test_pointer_adoption)
bpl_test(operators)
@@ -149,8 +152,11 @@
# and fixed, this should be retested.
# <toolset>hp_cxx:<build>no
+boost_python_extension(map_indexing_suite_ext
+ map_indexing_suite.cpp int_map_indexing_suite.cpp)
+
bpl_test(map_indexing_suite
- map_indexing_suite.py map_indexing_suite.cpp int_map_indexing_suite.cpp)
+ map_indexing_suite.py map_indexing_suite_ext)
# --- unit tests of library components ---
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