Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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 Boeckel
VTK
Commits
7e984a5d
Commit
7e984a5d
authored
6 years ago
by
Ben Boeckel
Browse files
Options
Downloads
Patches
Plain Diff
Findmpi4py: add imported targets
parent
339c20c2
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
CMake/Findmpi4py.cmake
+36
-0
36 additions, 0 deletions
CMake/Findmpi4py.cmake
with
36 additions
and
0 deletions
CMake/Findmpi4py.cmake
0 → 100644
+
36
−
0
View file @
7e984a5d
include
(
CMakeFindDependencyMacro
)
find_dependency
(
PythonInterp
)
execute_process
(
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
-c
"import mpi4py"
OUTPUT_VARIABLE _mpi4py_out
ERROR_VARIABLE _mpi4py_out
RESULT_VARIABLE _mpi4py_res
)
if
(
_mpi4py_res
)
set
(
mpi4py_FOUND 0
)
endif
()
if
(
NOT mpi4py_INCLUDE_DIR OR NOT EXISTS
"
${
mpi4py_INCLUDE_DIR
}
"
)
execute_process
(
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
-c
"import mpi4py; print(mpi4py.get_include())"
OUTPUT_VARIABLE _mpi4py_INCLUDE_DIR
RESULT_VARIABLE _mpi4py_include_dir_res
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
_mpi4py_include_dir_res
)
set
(
mpi4py_FOUND 0
)
endif
()
set
(
mpi4py_INCLUDE_DIR
"
${
_mpi4py_INCLUDE_DIR
}
"
CACHE INTERNAL
"Path of the MPI4Py include directory"
)
endif
()
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
mpi4py
REQUIRED_VARS mpi4py_INCLUDE_DIR
)
if
(
mpi4py_FOUND AND NOT TARGET mpi4py::mpi4py
)
add_library
(
mpi4py::mpi4py INTERFACE IMPORTED
)
set_target_properties
(
mpi4py::mpi4py
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
"
${
mpi4py_INCLUDE_DIR
}
"
)
endif
()
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