This reapplies the changes from 65689f19. Now that we depend on CMake >= 3.5, Boost::boost can be used.