--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,7 +36,12 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads REQUIRED)
 target_link_libraries(trojan ${CMAKE_THREAD_LIBS_INIT})
 
-find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options)
+find_package(Boost 1.66.0 REQUIRED)
+if (Boost_MAJOR_VERSION LESS_EQUAL 1 AND Boost_MINOR_VERSION LESS 89)
+    find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options)
+else()
+    find_package(Boost 1.66.0 REQUIRED COMPONENTS program_options)
+endif()
 include_directories(${Boost_INCLUDE_DIR})
 target_link_libraries(trojan ${Boost_LIBRARIES})
 if(MSVC)
