#!/usr/bin/env python
Import('boost_env')
Import('user_options_dict')

lib_dir = user_options_dict['LIB_BUILD_DIR']
#
# Boost.Test
#
butf_env = boost_env.Clone()

butf_src = 'libs/test/src/'
butf_source_files = [
                butf_src + 'compiler_log_formatter.cpp',
                butf_src + 'execution_monitor.cpp',
                butf_src + 'framework.cpp',
                butf_src + 'plain_report_formatter.cpp',
                butf_src + 'progress_monitor.cpp',
                butf_src + 'results_collector.cpp',
                butf_src + 'results_reporter.cpp',
                butf_src + 'test_tools.cpp',
                butf_src + 'unit_test_log.cpp',
                butf_src + 'unit_test_main.cpp',
                butf_src + 'unit_test_monitor.cpp',
                butf_src + 'unit_test_parameters.cpp',
                butf_src + 'unit_test_suite.cpp',
                butf_src + 'xml_log_formatter.cpp',
                butf_src + 'xml_report_formatter.cpp'
               ]

# libboost_unit_test_framework.a
# Depends('.',
#         butf_env.Library( target = user_options_dict['LIB_BUILD_DIR']+'/boost_unit_test_framework', source = butf_source_files )
#        )
butf_env.Library( target = lib_dir+'/boost_unit_test_framework', source = butf_source_files )

#
# Boost.Filesystem
#
bfs_env = butf_env

bfs_src = 'libs/filesystem/src/'
bfs_source_files = [
                bfs_src + 'convenience.cpp',
                bfs_src + 'exception.cpp',
                bfs_src + 'operations_posix_windows.cpp',
                bfs_src + 'path_posix_windows.cpp'
               ]
# libboost_filesystem.a
bfs_env.Library( target = lib_dir+'/boost_filesystem', source = bfs_source_files )

#
# Boost.Regex
#
# If there will be need for ICU then add "-DBOOST_HAS_ICU=1" + corresponding lib for linking,
# see libs/regex/build/Jamfile(Jamfile.v2)
brg_env = butf_env

brg_src = 'libs/regex/src/'
brg_source_files = [
                brg_src + 'c_regex_traits.cpp',
                brg_src + 'cpp_regex_traits.cpp',
                brg_src + 'cregex.cpp',
                brg_src + 'fileiter.cpp',
                brg_src + 'icu.cpp',
                brg_src + 'instances.cpp',
                brg_src + 'posix_api.cpp',
                brg_src + 'regex.cpp',
                brg_src + 'regex_debug.cpp',
                brg_src + 'regex_raw_buffer.cpp',
                brg_src + 'regex_traits_defaults.cpp',
                brg_src + 'static_mutex.cpp',
                brg_src + 'w32_regex_traits.cpp',
                brg_src + 'wc_regex_traits.cpp',
                brg_src + 'wide_posix_api.cpp',
                brg_src + 'winstances.cpp',
                brg_src + 'usinstances.cpp'
               ]
# libboost_regex.a
bfs_env.Library( target = lib_dir+'/boost_regex', source = brg_source_files )

