瀏覽代碼

Merge topic 'FindBoost-no-warn'

90467747a1 FindBoost: Add option to suppress new boost version dependency warning

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5794
Brad King 4 年之前
父節點
當前提交
ea07176b9a
共有 2 個文件被更改,包括 13 次插入1 次删除
  1. 6 0
      Help/release/dev/FindBoost-no-warn.rst
  2. 7 1
      Modules/FindBoost.cmake

+ 6 - 0
Help/release/dev/FindBoost-no-warn.rst

@@ -0,0 +1,6 @@
+FindBoost-no-warn
+-----------------
+
+* The :module:`FindBoost` module gained a ``Boost_NO_WARN_NEW_VERSIONS``
+  option to silence the warning about unknown dependencies for new
+  Boost versions.

+ 7 - 1
Modules/FindBoost.cmake

@@ -296,6 +296,12 @@ Other variables one may set to control this module are:
   Default value for ``Boost_LIBRARY_DIR_RELEASE`` and
   Default value for ``Boost_LIBRARY_DIR_RELEASE`` and
   ``Boost_LIBRARY_DIR_DEBUG``.
   ``Boost_LIBRARY_DIR_DEBUG``.
 
 
+``Boost_NO_WARN_NEW_VERSIONS``
+  .. versionadded:: 3.20
+
+  Set to ``ON`` to suppress the warning about unknown dependencies for new
+  Boost versions.
+
 On Visual Studio and Borland compilers Boost headers request automatic
 On Visual Studio and Borland compilers Boost headers request automatic
 linking to corresponding libraries.  This requires matching libraries
 linking to corresponding libraries.  This requires matching libraries
 to be linked explicitly or available in the link library search path.
 to be linked explicitly or available in the link library search path.
@@ -1344,7 +1350,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
       set(_Boost_TIMER_DEPENDENCIES chrono)
       set(_Boost_TIMER_DEPENDENCIES chrono)
       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
-      if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.76.0)
+      if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.76.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
         message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
         message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
       endif()
       endif()
     endif()
     endif()