Use simpler syntax to set the INTERFACE_INCLUDE_DIRECTORIES

git grep -l "EXPORT \${PROJECT_NAME}Targets)" | xargs sed -i 's|EXPORT \${PROJECT_NAME}Targets)|EXPORT ${PROJECT_NAME}Targets\n  INCLUDES DESTINATION include\n  )|'
git grep -l "\$<INSTALL_INTERFACE:\${CMAKE_INSTALL_PREFIX}/include>" | xargs sed -i '/\$<INSTALL_INTERFACE:\${CMAKE_INSTALL_PREFIX}\/include>/d'
Add macro to write a config file.
Add some CMake Config files.

.#!/usr/bin/env python

import os

handle = os.popen("git grep \"^project\"", "r")

info = handle.read().splitlines()

packages = {}

files = []

for item in info:
  f, content = item.split(":", 1)
  name = content.split("project(")[1].split()[0].split("Boost")[1]

  if name[-1] == ")":
    name = name[:-1]

  handle = os.popen("git grep -h \"ALIAS\" " + f, "r")

  matches = handle.read().splitlines()

  files.append(f)

  for match in matches:
    lib = match.split("add_library(")[1].split()[0]
    packages[lib] = name

for f in files:
  handle = open(f)
  lines = handle.read().splitlines()
  processingLibs = False
  deps = []
  for line in lines:
    if "target_link_libraries" in line and ("INTERFACE" in line or "PUBLIC" in line):
      processingLibs = True
      continue
    if processingLibs and ")" in line:
      break
    if processingLibs:
      lib = line.strip()
      if "boost::" in lib:
        deps.append(packages[lib])

  if deps:
    handle = open(f, "a")
    handle.write('''
write_config_file(\"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake\"
''')
    for dep in deps:
      handle.write("  " + dep + "\n")
    handle.write('''  )
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
  VERSION ${BOOST_VERSION}
  COMPATIBILITY AnyNewerVersion
  )

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
  DESTINATION lib/cmake/${PROJECT_NAME}
)
''')
Write more config files

These libraries do not list any dependencies in their LINK_LIBRARIES,
(which is a bug in all cases), but create a config file for them
anyway.

Slightly modified script:

.#!/usr/bin/env python

import os

handle = os.popen("git grep \"^project\"", "r")

info = handle.read().splitlines()

packages = {}

files = []

for item in info:
  f, content = item.split(":", 1)
  name = content.split("project(")[1].split()[0].split("Boost")[1]

  if name[-1] == ")":
    name = name[:-1]

  handle = os.popen("git grep -h \"ALIAS\" " + f, "r")

  matches = handle.read().splitlines()

  files.append(f)

  for match in matches:
    lib = match.split("add_library(")[1].split()[0]
    packages[lib] = name

for f in files:
  handle = open(f)
  content = handle.read()
  if "write_config_file" in content:
    continue

  lines = content.splitlines()
  processingLibs = False
  deps = []
  for line in lines:
    if "target_link_libraries" in line and ("INTERFACE" in line or "PUBLIC" in line):
      processingLibs = True
      continue
    if processingLibs and ")" in line:
      break
    if processingLibs:
      lib = line.strip()
      if "boost::" in lib:
        deps.append(packages[lib])

  handle = open(f, "a")
  handle.write('''
write_config_file(\"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake\")
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
  VERSION ${BOOST_VERSION}
  COMPATIBILITY AnyNewerVersion
  )

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
  DESTINATION lib/cmake/${PROJECT_NAME}
)
''')