123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
-
-
-
- set(library_component FALSE)
-
-
- 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")
-
- if(component STREQUAL "mpi_python")
- set(_boost_DEPS "python")
- set(library_component TRUE)
- set(_boost_unprocessed_headers ${_boost_mpi_python_headers})
-
- elseif(component STREQUAL "numpy")
- set(_boost_DEPS "python")
- set(library_component TRUE)
- set(_boost_unprocessed_headers ${_boost_python_numpy_headers})
-
- 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 "boost/serialization.hpp")
-
- 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 "boost/math.hpp")
-
- elseif(component STREQUAL "unit_test_framework")
- set(library_component TRUE)
- set(_boost_unprocessed_headers "${BOOST_DIR}/test/unit_test.hpp")
-
- elseif(component STREQUAL "prg_exec_monitor")
- set(library_component TRUE)
- set(_boost_unprocessed_headers "${BOOST_DIR}/test/prg_exec_monitor.hpp")
-
- elseif(component STREQUAL "test_exec_monitor")
- set(library_component TRUE)
- set(_boost_unprocessed_headers "${BOOST_DIR}/test/test_exec_monitor.hpp")
- else()
-
- file(GLOB_RECURSE _boost_unprocessed_headers
- RELATIVE "${includedir}"
- "${includedir}/boost/${component}/*")
- 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)
- list(APPEND _boost_processed_headers ${_boost_unprocessed_headers})
- foreach(header ${_boost_unprocessed_headers})
- if(EXISTS "${includedir}/${header}")
- file(STRINGS "${includedir}/${header}" _boost_header_includes REGEX "^#[ \t]*include[ \t]*<boost/[^>][^>]*>")
-
-
- file(STRINGS "${includedir}/${header}" _boost_header_deps REGEX "^[ \t]*#[ \t]*define[ \t][ \t]*BOOST_LIB_NAME[ \t][ \t]*boost_")
- foreach(line ${_boost_header_includes})
- string(REGEX REPLACE "^#[ \t]*include[ \t]*<(boost/[^>][^>]*)>.*" "\\1" _boost_header_match "${line}")
- list(FIND _boost_processed_headers "${_boost_header_match}" _boost_header_processed)
- list(FIND _boost_new_headers "${_boost_header_match}" _boost_header_new)
- if (_boost_header_processed EQUAL -1 AND _boost_header_new EQUAL -1)
- list(APPEND _boost_new_headers ${_boost_header_match})
- endif()
- endforeach()
- 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")
-
-
-
-
-
- continue()
- endif()
- if(component STREQUAL "mpi" AND
- (_boost_component_match STREQUAL "mpi_python" OR
- _boost_component_match STREQUAL "python"))
-
-
- continue()
- endif()
- if(component STREQUAL "python" AND
- boost_component_match STREQUAL "numpy")
-
-
- continue()
- endif()
- if (_boost_dep_found EQUAL -1 AND
- NOT "${_boost_component_match}" STREQUAL "${component}")
- list(APPEND _boost_DEPS "${_boost_component_match}")
- endif()
- if("${_boost_component_match}" STREQUAL "${component}")
- set(library_component TRUE)
- endif()
- endforeach()
- endif()
- endforeach()
- set(_boost_unprocessed_headers ${_boost_new_headers})
- unset(_boost_new_headers)
- endwhile()
-
- if(NOT library_component)
- unset(_boost_DEPS)
- endif()
- set(${_ret_libs} ${_boost_DEPS} PARENT_SCOPE)
-
-
-
-
-
- endfunction()
- message(STATUS "Scanning ${BOOST_DIR}")
- file(GLOB boost_contents RELATIVE "${BOOST_DIR}/boost" "${BOOST_DIR}/boost/*")
- foreach(component ${boost_contents})
- if(IS_DIRECTORY "${BOOST_DIR}/boost/${component}")
- list(APPEND boost_components "${component}")
- endif()
- endforeach()
- if(IS_DIRECTORY "${BOOST_DIR}/boost/mpi" AND
- IS_DIRECTORY "${BOOST_DIR}/boost/python")
- list(APPEND boost_components "mpi_python")
- endif()
- if(IS_DIRECTORY "${BOOST_DIR}/boost/python" AND
- IS_DIRECTORY "${BOOST_DIR}/boost/python/numpy")
- list(APPEND boost_components "numpy")
- endif()
- if(IS_DIRECTORY "${BOOST_DIR}/boost/serialization")
- list(APPEND boost_components "wserialization")
- endif()
- if(EXISTS "${BOOST_DIR}/test/unit_test.hpp")
- list(APPEND boost_components "unit_test_framework")
- endif()
- if(EXISTS "${BOOST_DIR}/test/prg_exec_monitor.hpp")
- list(APPEND boost_components "prg_exec_monitor")
- endif()
- if(EXISTS "${BOOST_DIR}/test/test_exec_monitor.hpp")
- list(APPEND boost_components "test_exec_monitor")
- endif()
- if(boost_components)
- list(SORT boost_components)
- endif()
- foreach(component ${boost_components})
- string(TOUPPER ${component} UPPERCOMPONENT)
- _Boost_FIND_COMPONENT_DEPENDENCIES("${component}" "${BOOST_DIR}"
- _Boost_${UPPERCOMPONENT}_LIBRARY_DEPENDENCIES)
- endforeach()
- foreach(component ${boost_components})
- string(TOUPPER ${component} UPPERCOMPONENT)
- if(_Boost_${UPPERCOMPONENT}_LIBRARY_DEPENDENCIES)
- string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${UPPERCOMPONENT}_LIBRARY_DEPENDENCIES}")
- message(STATUS "set(_Boost_${UPPERCOMPONENT}_DEPENDENCIES ${_boost_DEPS_STRING})")
- endif()
- endforeach()
|