2
0
mirror of https://github.com/boostorg/tr1.git synced 2026-01-19 04:42:14 +00:00

Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor

[SVN r49510]
This commit is contained in:
Michael A. Jackson
2008-11-01 13:15:41 +00:00
parent 06a70848dd
commit becd89fd75
3 changed files with 82 additions and 0 deletions

21
CMakeLists.txt Normal file
View File

@@ -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 <john -at- johnmaddock.co.uk>"
# MAINTAINERS
)

1
module.cmake Normal file
View File

@@ -0,0 +1 @@
boost_module(tr1 DEPENDS fusion)

60
test/CMakeLists.txt Normal file
View File

@@ -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 "")