I know next to nothing about CMake, but this doesn't seem quite the right way.
This:
set(BOOST_FILESYSTEM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" CACHE STRING "Location of boost.filesystem headers")
should perhaps just be
target_include_directories(boost_filesystem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
The manual dependency checking at the top:
if(NOT BOOST_CONFIG_INCLUDE_DIRS) message(FATAL_ERROR "Cannot find boost.config!") endif(NOT BOOST_CONFIG_INCLUDE_DIRS)
should probably be replaced by
target_link_libraries(boost_config)
boost_config, being a header-only library, should be
add_library(boost_config INTERFACE)
The various BOOST_*_INCLUDE_DIRS and BOOST_*_LIBRARIES won't be needed; CMake will figure it out automatically. And the order of add_subdirectory will no longer matter.
Thanks for that! I did not know CMake had that functionality.