From 29b9db8d67c67d4d1303e8dd9804f698fbaefbe1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 13 Jan 2017 19:37:37 +0000 Subject: Bindings: Add a script to generate __init__.py file for bindings Packagers can execute this script with cmake -D PYTHON_UMBRELLA_MODULE_FILE=/where/ever/PyKF5/__init__.py -P /path/to/ECM/find-modules/GeneratePythonBindingUmbrellaModule.cmake Soon, this is likely to do more than create an empty file. --- find-modules/FindPythonModuleGeneration.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'find-modules/FindPythonModuleGeneration.cmake') diff --git a/find-modules/FindPythonModuleGeneration.cmake b/find-modules/FindPythonModuleGeneration.cmake index 7a4f7d45..434c4381 100644 --- a/find-modules/FindPythonModuleGeneration.cmake +++ b/find-modules/FindPythonModuleGeneration.cmake @@ -422,9 +422,11 @@ headers = sipAPI${modulename_value} "${CMAKE_CURRENT_BINARY_DIR}/pybuild/${pythonnamespace_value}/${modulename_value}") foreach(pyversion ${_pyversions}) - file(MAKE_DIRECTORY - "${CMAKE_CURRENT_BINARY_DIR}/py${pyversion}/${pythonnamespace_value}") - execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/py${pyversion}/${pythonnamespace_value}/__init__.py") + + execute_process(COMMAND "${CMAKE_COMMAND}" + "-DPYTHON_UMBRELLA_MODULE_FILE=${CMAKE_CURRENT_BINARY_DIR}/py${pyversion}/${pythonnamespace_value}/__init__.py" + -P "${GPB_MODULE_DIR}/GeneratePythonBindingUmbrellaModule.cmake" + ) add_library(Py${pyversion}KF5${modulename_value} MODULE "${CMAKE_CURRENT_BINARY_DIR}/pybuild/${pythonnamespace_value}/${modulename_value}/unified${modulename_value}.cpp" -- cgit v1.2.1