summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-24 13:33:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-08-24 13:34:22 (GMT)
commit65ca67cef19bae85c4fd3582b474e9f95d3c9eb1 (patch)
tree1bdeaf0442e0fc6d8ae2b92f944940a1e22b620f /Utilities
parent94299c496d54d037db35575447b011c6c8a35b0a (diff)
parentfa114e7d708b76f33878f6f82a6c2a2e50c1c10f (diff)
downloadCMake-65ca67cef19bae85c4fd3582b474e9f95d3c9eb1.zip
CMake-65ca67cef19bae85c4fd3582b474e9f95d3c9eb1.tar.gz
CMake-65ca67cef19bae85c4fd3582b474e9f95d3c9eb1.tar.bz2
Merge topic 'boost-1.65'
fa114e7d FindBoost: Add Boost 1.65 dependencies e66e8e89 BoostScanDeps: Special case python and numpy and variants Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1172
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/Scripts/BoostScanDeps.cmake39
1 files changed, 32 insertions, 7 deletions
diff --git a/Utilities/Scripts/BoostScanDeps.cmake b/Utilities/Scripts/BoostScanDeps.cmake
index 2fd8f86..bd2e6a8 100644
--- a/Utilities/Scripts/BoostScanDeps.cmake
+++ b/Utilities/Scripts/BoostScanDeps.cmake
@@ -39,29 +39,40 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
# Start by finding all headers for the component; header
# dependencies via #include will be solved by future passes
+ file(GLOB_RECURSE _boost_mpi_python_headers
+ RELATIVE "${includedir}"
+ "${includedir}/boost/mpi/python/*")
+ list(INSERT _boost_mpi_python_headers 0 "boost/mpi/python.hpp")
+
+ file(GLOB_RECURSE _boost_python_numpy_headers
+ RELATIVE "${includedir}"
+ "${includedir}/boost/python/numpy/*")
+ list(INSERT _boost_python_numpy_headers 0 "boost/python/numpy.hpp")
# Special-case since it is part of mpi; look only in boost/mpi/python*
if(component STREQUAL "mpi_python")
set(_boost_DEPS "python")
set(library_component TRUE)
- file(GLOB_RECURSE _boost_unprocessed_headers
- RELATIVE "${includedir}"
- "${includedir}/boost/mpi/python/*")
- list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/mpi/python.hpp")
+ set(_boost_unprocessed_headers ${_boost_mpi_python_headers})
+ # Special-case since it is part of python; look only in boost/python/numpy*
+ elseif(component STREQUAL "numpy")
+ set(_boost_DEPS "python")
+ set(library_component TRUE)
+ set(_boost_unprocessed_headers ${_boost_python_numpy_headers})
# Special-case since it is a serialization variant; look in boost/serialization
elseif(component STREQUAL "wserialization")
set(library_component TRUE)
file(GLOB_RECURSE _boost_unprocessed_headers
RELATIVE "${includedir}"
"${includedir}/boost/serialization/*")
- list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/serialization.hpp")
+ list(INSERT _boost_unprocessed_headers 0 "boost/serialization.hpp")
# Not really a library in its own right, but treat it as one
elseif(component STREQUAL "math")
set(library_component TRUE)
file(GLOB_RECURSE _boost_unprocessed_headers
RELATIVE "${includedir}"
"${includedir}/boost/math/*")
- list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/math.hpp")
+ list(INSERT _boost_unprocessed_headers 0 "boost/math.hpp")
# Single test header
elseif(component STREQUAL "unit_test_framework")
set(library_component TRUE)
@@ -79,7 +90,8 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
file(GLOB_RECURSE _boost_unprocessed_headers
RELATIVE "${includedir}"
"${includedir}/boost/${component}/*")
- list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/${component}.hpp")
+ list(INSERT _boost_unprocessed_headers 0 "boost/${component}.hpp")
+ list(REMOVE_ITEM _boost_unprocessed_headers ${_boost_mpi_python_headers} ${_boost_python_numpy_headers})
endif()
while(_boost_unprocessed_headers)
@@ -102,6 +114,8 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
foreach(line ${_boost_header_deps})
string(REGEX REPLACE "^[ \t]*#[ \t]*define[ \t][ \t]*BOOST_LIB_NAME[ \t][ \t]*boost_([^ \t][^ \t]*).*" "\\1" _boost_component_match "${line}")
+ string(REPLACE "python3" "python" _boost_component_match "${_boost_component_match}")
+ string(REPLACE "numpy3" "numpy" _boost_component_match "${_boost_component_match}")
list(FIND _boost_DEPS "${_boost_component_match}" _boost_dep_found)
if(_boost_component_match STREQUAL "bzip2" OR
_boost_component_match STREQUAL "zlib")
@@ -119,6 +133,12 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
# hard dependency (handle as special-case for mpi_python).
continue()
endif()
+ if(component STREQUAL "python" AND
+ boost_component_match STREQUAL "numpy")
+ # Optional python dependency; skip to avoid making it a
+ # hard dependency (handle as special-case for numpy).
+ continue()
+ endif()
if (_boost_dep_found EQUAL -1 AND
NOT "${_boost_component_match}" STREQUAL "${component}")
list(APPEND _boost_DEPS "${_boost_component_match}")
@@ -168,6 +188,11 @@ if(IS_DIRECTORY "${BOOST_DIR}/boost/mpi" AND
IS_DIRECTORY "${BOOST_DIR}/boost/python")
list(APPEND boost_components "mpi_python")
endif()
+# Special-case numpy, since it's a part of python
+if(IS_DIRECTORY "${BOOST_DIR}/boost/python" AND
+ IS_DIRECTORY "${BOOST_DIR}/boost/python/numpy")
+ list(APPEND boost_components "numpy")
+endif()
# Special-case wserialization, which is a variant of serialization
if(IS_DIRECTORY "${BOOST_DIR}/boost/serialization")
list(APPEND boost_components "wserialization")