Skip to content
Snippets Groups Projects
Commit ce1d6fcf authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

WIP: check presence of Py packages (#200)

parent 3a768bdc
No related branches found
No related tags found
No related merge requests found
Pipeline #57106 failed
......@@ -153,6 +153,15 @@ if(BORNAGAIN_PYTHON OR BORNAGAIN_PYTHON_PACKAGE_VERSIONS)
endif()
endif()
foreach(pkg build setuptools wheel)
execute_process(
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/cmake/tests/find_pkg.py ${PKG}
RESULT_VARIABLE PKG_FOUND)
if(NOT PKG_FOUND)
message(FATAL_ERROR "Python package ${pkg} not found")
endif()
endforeach()
#-- add multiple versions of Python, as required
include("BornAgain/multipython/PyDependences")
find_multipython_dependences("${Python3_VERSION}")
......
#!/usr/bin/env python3
import sys
pkg = sys.argv[1]
print("find_pkg searching", pkg)
try:
__import__(pkg)
except:
print("package", pkg, "not found")
sys.exit(1)
print("package", pkg, "found")
sys.exit(0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment