merge of cmake build files from trunk per beman

[SVN r50756]
This commit is contained in:
Troy D. Straszheim
2009-01-24 18:57:20 +00:00
parent 2d43c1b305
commit 083ea3a6c7
3 changed files with 129 additions and 0 deletions

1
module.cmake Normal file
View File

@ -0,0 +1 @@
boost_module(regex DEPENDS date_time)

34
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,34 @@
# Look for the ICU library. If we find it, we'll compile in support for ICU
include(FindICU)
set(BOOST_REGEX_LIBRARIES)
if (ICU_FOUND AND ICU_I18N_FOUND)
add_definitions(-DBOOST_HAS_ICU=1)
include_directories(${ICU_INCLUDE_DIRS})
set(BOOST_REGEX_LIBRARIES ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
endif (ICU_FOUND AND ICU_I18N_FOUND)
boost_add_library(boost_regex
c_regex_traits.cpp
cpp_regex_traits.cpp
cregex.cpp
fileiter.cpp
icu.cpp
instances.cpp
posix_api.cpp
regex.cpp
regex_debug.cpp
regex_raw_buffer.cpp
regex_traits_defaults.cpp
static_mutex.cpp
w32_regex_traits.cpp
wc_regex_traits.cpp
wide_posix_api.cpp
winstances.cpp
usinstances.cpp
LINK_LIBS ${BOOST_REGEX_LIBRARIES}
SHARED_COMPILE_FLAGS -DBOOST_REGEX_DYN_LINK=1)

94
test/CMakeLists.txt Normal file
View File

@ -0,0 +1,94 @@
boost_additional_test_dependencies(regex BOOST_DEPENDS test)
# TODO: Default to multi-threaded?
macro(regex_test TESTNAME)
parse_arguments(REGEX_TEST "" "" ${ARGN})
if (REGEX_TEST_DEFAULT_ARGS)
set(REGEX_TEST_SOURCES ${REGEX_TEST_DEFAULT_ARGS})
else (REGEX_TEST_DEFAULT_ARGS)
set(REGEX_TEST_SOURCES "${TESTNAME}.cpp")
endif (REGEX_TEST_DEFAULT_ARGS)
boost_test_run(${TESTNAME} ${REGEX_TEST_SOURCES}
COMPILE_FLAGS "-DBOOST_REGEX_DYN_LINK=1"
DEPENDS boost_regex
EXTRA_OPTIONS SHARED)
endmacro(regex_test)
set(R_SOURCES
regress/basic_tests.cpp
regress/main.cpp
regress/test_alt.cpp
regress/test_anchors.cpp
regress/test_asserts.cpp
regress/test_backrefs.cpp
regress/test_deprecated.cpp
regress/test_emacs.cpp
regress/test_escapes.cpp
regress/test_grep.cpp
regress/test_locale.cpp
regress/test_mfc.cpp
regress/test_non_greedy_repeats.cpp
regress/test_perl_ex.cpp
regress/test_replace.cpp
regress/test_sets.cpp
regress/test_simple_repeats.cpp
regress/test_tricky_cases.cpp
regress/test_icu.cpp
regress/test_unicode.cpp
regress/test_overloads.cpp
regress/test_operators.cpp
)
boost_test_run(regex_regress ${R_SOURCES} DEPENDS boost_regex STATIC)
boost_test_run(regex_regress_dll ${R_SOURCES}
COMPILE_FLAGS "-DBOOST_REGEX_DYN_LINK=1"
DEPENDS boost_regex
EXTRA_OPTIONS SHARED)
boost_test_run(regex_regress_threaded ${R_SOURCES}
COMPILE_FLAGS "-DTEST_THREADS -DBOOST_REGEX_DYN_LINK=1"
DEPENDS boost_regex boost_thread
EXTRA_OPTIONS SHARED MULTI_THREADED)
regex_test(posix_api_check c_compiler_checks/posix_api_check.c)
boost_test_compile(wide_posix_api_check_c c_compiler_checks/wide_posix_api_check.c)
regex_test(posix_api_check_cpp c_compiler_checks/wide_posix_api_check.cpp)
regex_test(bad_expression_test pathology/bad_expression_test.cpp)
regex_test(recursion_test pathology/recursion_test.cpp)
regex_test(unicode_iterator_test unicode/unicode_iterator_test.cpp)
boost_test_run(static_mutex_test static_mutex/static_mutex_test.cpp
COMPILE_FLAGS "-DBOOST_REGEX_DYN_LINK=1"
DEPENDS boost_regex boost_thread
EXTRA_OPTIONS MULTI_THREADED SHARED)
regex_test(object_cache_test object_cache/object_cache_test.cpp)
boost_test_run(regex_config_info config_info/regex_config_info.cpp
DEPENDS boost_regex
EXTRA_OPTIONS STATIC)
boost_test_run(regex_dll_config_info config_info/regex_config_info.cpp
COMPILE_FLAGS "-DBOOST_REGEX_DYN_LINK=1"
DEPENDS boost_regex
EXTRA_OPTIONS SHARED)
regex_test(test_collate_info collate_info/collate_info.cpp)
boost_test_compile(concept_check concepts/concept_check.cpp)
boost_test_compile(ice_concept_check concepts/icu_concept_check.cpp)
# TODO: Deal with this
# [ run
# sources
# captures/captures_test.cpp
# captures//boost_regex_extra
#: # additional args
#: # test-files
#: # requirements
# <threading>multi
# <define>BOOST_REGEX_MATCH_EXTRA=1
# <define>BOOST_REGEX_NO_LIB=1
# : # test name
# captures_test
# ]