if you have Boost in dependencies, you should add find_package for it before (compile_project)
for example:
https://github.com/sidorovis/cpp_craft_1013/blob/master/solutions/ivan_sidarau/3/sources/3_4/CMakeLists.txt