Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Stone
CMake
Commits
e66e8e89
Commit
e66e8e89
authored
7 years ago
by
Roger Leigh
Browse files
Options
Downloads
Patches
Plain Diff
BoostScanDeps: Special case python and numpy and variants
parent
2d41ec50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Utilities/Scripts/BoostScanDeps.cmake
+32
-7
32 additions, 7 deletions
Utilities/Scripts/BoostScanDeps.cmake
with
32 additions
and
7 deletions
Utilities/Scripts/BoostScanDeps.cmake
+
32
−
7
View file @
e66e8e89
...
...
@@ -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"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment