parameters: (src_dir, target_dir)
docstring: Copy source tree into build directory.
docstring_summary: Copy source tree into build directory.
docstring_tokens: Copy source tree into build directory .
function: def copy_tree(src_dir, target_dir):
      """Copy source tree into build directory."""
      logger = logging.getLogger('Treelite copy_tree')
      def clean_copy_tree(src, dst):
          logger.info('Copy tree %s -> %s', src, dst)
          distutils.dir_util.copy_tree(src, dst)
          NEED_CLEAN_TREE.add(os.path.abspath(dst))
  
      def clean_copy_file(src, dst):
          logger.info('Copy tree %s -> %s', src, dst)
          distutils.file_util.copy_file(src, dst)
          NEED_CLEAN_FILE.add(os.path.abspath(dst))
  
      cmake = os.path.join(src_dir, 'cmake')
      inc = os.path.join(src_dir, 'include')
      src = os.path.join(src_dir, 'src')
  
      clean_copy_tree(cmake, os.path.join(target_dir, 'cmake'))
      clean_copy_tree(inc, os.path.join(target_dir, 'include'))
      clean_copy_tree(src, os.path.join(target_dir, 'src'))
  
      cmake_list = os.path.join(src_dir, 'CMakeLists.txt')
      clean_copy_file(cmake_list, os.path.join(target_dir, 'CMakeLists.txt'))
      lic = os.path.join(src_dir, 'LICENSE')
      clean_copy_file(lic, os.path.join(target_dir, 'LICENSE'))
function_tokens: def copy_tree ( src_dir , target_dir ) : logger = logging . getLogger ( 'Treelite copy_tree' ) def clean_copy_tree ( src , dst ) : logger . info ( 'Copy tree %s -> %s' , src , dst ) distutils . dir_util . copy_tree ( src , dst ) NEED_CLEAN_TREE . add ( os . path . abspath ( dst ) ) def clean_copy_file ( src , dst ) : logger . info ( 'Copy tree %s -> %s' , src , dst ) distutils . file_util . copy_file ( src , dst ) NEED_CLEAN_FILE . add ( os . path . abspath ( dst ) ) cmake = os . path . join ( src_dir , 'cmake' ) inc = os . path . join ( src_dir , 'include' ) src = os . path . join ( src_dir , 'src' ) clean_copy_tree ( cmake , os . path . join ( target_dir , 'cmake' ) ) clean_copy_tree ( inc , os . path . join ( target_dir , 'include' ) ) clean_copy_tree ( src , os . path . join ( target_dir , 'src' ) ) cmake_list = os . path . join ( src_dir , 'CMakeLists.txt' ) clean_copy_file ( cmake_list , os . path . join ( target_dir , 'CMakeLists.txt' ) ) lic = os . path . join ( src_dir , 'LICENSE' ) clean_copy_file ( lic , os . path . join ( target_dir , 'LICENSE' ) )