From 083ea3a6c71090bbad9dfd14a49eb60b96ba4fea Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sat, 24 Jan 2009 18:57:20 +0000 Subject: [PATCH] merge of cmake build files from trunk per beman [SVN r50756] --- module.cmake | 1 + src/CMakeLists.txt | 34 ++++++++++++++++ test/CMakeLists.txt | 94 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 module.cmake create mode 100644 src/CMakeLists.txt create mode 100644 test/CMakeLists.txt diff --git a/module.cmake b/module.cmake new file mode 100644 index 00000000..161eea0e --- /dev/null +++ b/module.cmake @@ -0,0 +1 @@ +boost_module(regex DEPENDS date_time) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..be9383e1 --- /dev/null +++ b/src/CMakeLists.txt @@ -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) + + + + + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 00000000..3de3d9e3 --- /dev/null +++ b/test/CMakeLists.txt @@ -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 + # multi + # BOOST_REGEX_MATCH_EXTRA=1 + # BOOST_REGEX_NO_LIB=1 +# : # test name + # captures_test +# ]