Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mpi4py required #2213

Merged
merged 1 commit into from
May 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions cmake/FindPythonModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,19 @@ set( PythonModule_${module_NAME}_PATH
endif()

include(FindPackageHandleStandardArgs)
set(FPHSA_NAME_MISMATCHED TRUE)
set(CMAKE_FIND_PACKAGE_NAME PythonModule_${module_NAME})
foreach(VAR IN ITEMS REQUIRED QUIETLY VERSION COMPONENTS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other variables as well. Whenever I need to do something like this, I refer to this list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through the list and the individual components are handled differently so those are intentionally skipped. The remaining are specific version components which should be okay just handling the whole version variable, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works as is then I guess that's OK.

if(DEFINED PythonModule_FIND_${VAR})
set(PythonModule_${module_NAME}_FIND_${VAR} "${PythonModule_FIND_${VAR}}")
else()
unset(PythonModule_${module_NAME}_FIND_${VAR})
endif()
endforeach()

find_package_handle_standard_args(PythonModule_${module_NAME}
FOUND_VAR PythonModule_${module_NAME}_FOUND
REQUIRED_VARS ${required_vars}
)
unset(FPHSA_NAME_MISMATCHED)
endif()

if(PythonModule_${module_NAME}_FOUND AND
Expand Down