summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-22 15:20:48 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-22 15:20:53 (GMT)
commit5d13fa1010223a65e64f5270db06ada9c6a0ae0d (patch)
treea04ca0e5256b64dd2edccf41b49690a76b26fa4c /Modules
parentde9c3d796491daf6276fe6df25b3ef5d85501ff0 (diff)
parent2557cad5ec5084f86d4bb56c82939a49fc9d3071 (diff)
downloadCMake-5d13fa1010223a65e64f5270db06ada9c6a0ae0d.zip
CMake-5d13fa1010223a65e64f5270db06ada9c6a0ae0d.tar.gz
CMake-5d13fa1010223a65e64f5270db06ada9c6a0ae0d.tar.bz2
Merge topic 'boost-optional-components'
2557cad5 FindBoost: support OPTIONAL_COMPONENTS Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Paul "TBBle" Hampson <paul.hampson@pobox.com> Merge-request: !1660
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindBoost.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index ca2a9c5..4a55588 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -13,6 +13,9 @@
# [version] [EXACT] # Minimum or EXACT version e.g. 1.36.0
# [REQUIRED] # Fail with error if Boost is not found
# [COMPONENTS <libs>...] # Boost libraries by their canonical name
+# # e.g. "date_time" for "libboost_date_time"
+# [OPTIONAL_COMPONENTS <libs>...]
+# # Optional Boost libraries by their canonical name)
# ) # e.g. "date_time" for "libboost_date_time"
#
# This module finds headers and requested component libraries OR a CMake
@@ -1777,10 +1780,9 @@ if(Boost_FOUND)
set(_boost_CHECKED_COMPONENT FALSE)
set(_Boost_MISSING_COMPONENTS "")
foreach(COMPONENT ${Boost_FIND_COMPONENTS})
- string(TOUPPER ${COMPONENT} COMPONENT)
+ string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
set(_boost_CHECKED_COMPONENT TRUE)
- if(NOT Boost_${COMPONENT}_FOUND)
- string(TOLOWER ${COMPONENT} COMPONENT)
+ if(NOT Boost_${UPPERCOMPONENT}_FOUND AND Boost_FIND_REQUIRED_${COMPONENT})
list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
endif()
endforeach()