aboutsummaryrefslogtreecommitdiff
path: root/find-modules
diff options
context:
space:
mode:
Diffstat (limited to 'find-modules')
-rw-r--r--find-modules/FindPythonModuleGeneration.cmake8
-rw-r--r--find-modules/GeneratePythonBindingUmbrellaModule.cmake7
2 files changed, 12 insertions, 3 deletions
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"
diff --git a/find-modules/GeneratePythonBindingUmbrellaModule.cmake b/find-modules/GeneratePythonBindingUmbrellaModule.cmake
new file mode 100644
index 00000000..35bbc2c5
--- /dev/null
+++ b/find-modules/GeneratePythonBindingUmbrellaModule.cmake
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.2)
+
+get_filename_component(PYTHON_UMBRELLA_MODULE_DIR ${PYTHON_UMBRELLA_MODULE_FILE} PATH)
+
+file(MAKE_DIRECTORY "${PYTHON_UMBRELLA_MODULE_DIR}")
+
+execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${PYTHON_UMBRELLA_MODULE_FILE}")