Skip to content

Commit

Permalink
python: Handle REQUIRED arguments for FindPythonModule
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Atkins committed May 6, 2020
1 parent a5c997e commit 03ee6a0
Showing 1 changed file with 9 additions and 2 deletions.
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)
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

0 comments on commit 03ee6a0

Please sign in to comment.