From becd89fd75555265269072d6dbc8a10caf46fb74 Mon Sep 17 00:00:00 2001 From: "Michael A. Jackson" Date: Sat, 1 Nov 2008 13:15:41 +0000 Subject: [PATCH] Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor [SVN r49510] --- CMakeLists.txt | 21 ++++++++++++++++ module.cmake | 1 + test/CMakeLists.txt | 60 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 module.cmake create mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..76a51df --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +#---------------------------------------------------------------------------- +# This file was automatically generated from the original CMakeLists.txt file +# Add a variable to hold the headers for the library +set (lib_headers + tr1 +) + +# Add a library target to the build system +boost_library_project( + tr1 + # SRCDIRS + TESTDIRS test + HEADERS ${lib_headers} + # DOCDIRS + DESCRIPTION "An implementation of the C++ Technical Report on Standard Library Extensions. This library does not itself implement the TR1 components, rather it's a thin wrapper that will include your standard library's TR1 implementation (if it has one), otherwise it will include the Boost Library equivalents, and import them into namespace std::tr1." + MODULARIZED + AUTHORS "John Maddock " + # MAINTAINERS +) + + diff --git a/module.cmake b/module.cmake new file mode 100644 index 0000000..f6e7da5 --- /dev/null +++ b/module.cmake @@ -0,0 +1 @@ +boost_module(tr1 DEPENDS fusion) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..4bc941b --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,60 @@ +include_directories(${Boost_SOURCE_DIR}/boost/tr1/tr1) +include_directories(${Boost_SOURCE_DIR}/libs/tr1/include/boost/tr1/tr1) + +if (BORLAND) + # Borland's broken include mechanism needs these extra headers: + include_directories(${Boost_SOURCE_DIR}/boost/tr1/tr1/bcc32) + include_directories(${Boost_SOURCE_DIR}/libs/tr1/include//boost/tr1/tr1/bcc32) +endif (BORLAND) + +macro(boost_glob_test_compile path glob_par compile_flags) + list_contains(WITH_STD "WITH_STD" ${ARGN}) + list_contains(STD_HEADER_TEST "STD_HEADER_TEST" ${ARGN}) + file(GLOB file_list ${path}/${glob_par}) + foreach (current_file ${file_list}) + get_filename_component(file_name ${current_file} NAME_WE) + set(test_name "${file_name}") + if (${STD_HEADER_TEST}) + set(test_name "${file_name}_header") + endif () + boost_test_compile(${test_name} ${path}/${file_name}.cpp + COMPILE_FLAGS "${compile_flags}") + if (WITH_STD) + boost_test_compile(${file_name}_std ${path}/${file_name}.cpp + COMPILE_FLAGS ${compile_flags} -DTEST_STD_HEADERS=1) + endif (WITH_STD) + endforeach (current_file) +endmacro(boost_glob_test_compile) + +macro(boost_glob_test_compile_fail patch glob_par compile_flags) + file(GLOB file_list ${glob_par}) + foreach (current_file ${file_list}) + get_filename_component(file_name ${current_file} NAME_WE) + boost_test_compile_fail(${file_name} ${path}/${file_name}.cpp COMPILE_FLAGS "${compile_flags}") + endforeach (current_file) +endmacro(boost_glob_test_compile_fail) + +macro(boost_glob_test_run path glob_par compile_flags) + list_contains(WITH_STD "WITH_STD" ${ARGN}) + file(GLOB file_list ${path}/${glob_par}) + foreach (current_file ${file_list}) + get_filename_component(file_name ${current_file} NAME_WE) + boost_test_run(${file_name} ${path}/${file_name}.cpp COMPILE_FLAGS "${compile_flags}") + if (WITH_STD) + boost_test_run(${file_name}_std ${path}/${file_name}.cpp + COMPILE_FLAGS ${compile_flags} -DTEST_STD_HEADERS=1) + endif (WITH_STD) + endforeach (current_file) +endmacro(boost_glob_test_run) + + +boost_glob_test_compile(. test*.cpp "" WITH_STD) +boost_glob_test_run(. run*.cpp "" WITH_STD) +boost_glob_test_compile_fail(config tr1_has_tr1*fail.cpp "") +boost_glob_test_compile(config tr1_has_tr1*pass.cpp "") +boost_glob_test_run(type_traits *.cpp "") +# TODO: there's a problem here where the testing code is generating duplicate +# target names. +message(STATUS "TR1 tests need some love") +# boost_glob_test_compile(std_headers *.cpp "-DTEST_STD=1" STD_HEADER_TEST) +boost_glob_test_compile(cyclic_depend *.cpp "")