summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2021-04-21 05:52:27 -0700
committerGitHub <noreply@github.com>2021-04-21 12:52:27 +0000
commit86aa9bc35ba9dc9a57913a2ffc71619c7657cc35 (patch)
treefd83663bfa637ecfa85f2b47385a93b210cc7e22
parent8062e5527ccf7a02266336bb37a5c0e7c82d971b (diff)
cmake: Add optional module name argument for check_python_module helper. (#6406)
Addtionally adds checks for required documentation modules.
-rw-r--r--cmake/Helpers.cmake10
-rw-r--r--docs/CMakeLists.txt2
2 files changed, 9 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()
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 2890148b7..4e18c0ba9 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -14,6 +14,8 @@
##
find_package(Sphinx REQUIRED)
check_python_module(breathe)
+check_python_module(sphinxcontrib.bibtex sphinxcontrib-bibtex)
+check_python_module(sphinx_tabs.tabs sphinx-tabs)
add_subdirectory(cpp)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback