002-Fix-boost1.89-build.patch 630 B

12345678910111213141516
  1. --- a/CMakeLists.txt
  2. +++ b/CMakeLists.txt
  3. @@ -36,7 +36,12 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
  4. find_package(Threads REQUIRED)
  5. target_link_libraries(trojan ${CMAKE_THREAD_LIBS_INIT})
  6. -find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options)
  7. +find_package(Boost 1.66.0 REQUIRED)
  8. +if (Boost_MAJOR_VERSION LESS_EQUAL 1 AND Boost_MINOR_VERSION LESS 89)
  9. + find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options)
  10. +else()
  11. + find_package(Boost 1.66.0 REQUIRED COMPONENTS program_options)
  12. +endif()
  13. include_directories(${Boost_INCLUDE_DIR})
  14. target_link_libraries(trojan ${Boost_LIBRARIES})
  15. if(MSVC)