diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2021-04-21 05:52:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 12:52:27 +0000 |
commit | 86aa9bc35ba9dc9a57913a2ffc71619c7657cc35 (patch) | |
tree | fd83663bfa637ecfa85f2b47385a93b210cc7e22 /cmake/Helpers.cmake | |
parent | 8062e5527ccf7a02266336bb37a5c0e7c82d971b (diff) |
cmake: Add optional module name argument for check_python_module helper. (#6406)
Addtionally adds checks for required documentation modules.
Diffstat (limited to 'cmake/Helpers.cmake')
-rw-r--r-- | cmake/Helpers.cmake | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/Helpers.cmake b/cmake/Helpers.cmake index 2a94839e2..bb102e482 100644 --- a/cmake/Helpers.cmake +++ b/cmake/Helpers.cmake @@ -191,13 +191,17 @@ function(check_python_module module) RET_MODULE_TEST ERROR_QUIET ) + set(module_name ${ARGN}) + if(NOT module_name) + set(module_name ${module}) + endif() if(RET_MODULE_TEST) message(FATAL_ERROR - "Could not find module ${module} for Python " + "Could not find module ${module_name} for Python " "version ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}. " - "Make sure to install ${module} for this Python version " - "via \n`${PYTHON_EXECUTABLE} -m pip install ${module}'.\n" + "Make sure to install ${module_name} for this Python version " + "via \n`${PYTHON_EXECUTABLE} -m pip install ${module_name}'.\n" "Note: You need to have pip installed for this Python version.") endif() endfunction() |