From 379ae36a1426ec1dd5738916fda414a55b6ce194 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 15 Jan 2017 12:38:58 +0000 Subject: Bindings: Use installed python modules if making a dependent module Only one directory may provide the PyKF5 namespace, so if testing KAuth, which depends on KCoreAddons, both have to be in the same directory. That means that the KAuth tests can only be run post-intallation which doesn't really cause problems. --- find-modules/FindPythonModuleGeneration.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'find-modules/FindPythonModuleGeneration.cmake') diff --git a/find-modules/FindPythonModuleGeneration.cmake b/find-modules/FindPythonModuleGeneration.cmake index c0e382ff..012f8062 100644 --- a/find-modules/FindPythonModuleGeneration.cmake +++ b/find-modules/FindPythonModuleGeneration.cmake @@ -443,7 +443,15 @@ headers = sipAPI${modulename_value} set_property(TARGET Py${pyversion}KF5${modulename_value} PROPERTY OUTPUT_NAME "${CMAKE_BINARY_DIR}/py${pyversion}/${pythonnamespace_value}/${modulename_value}") - add_test(NAME Py${pyversion}Test${modulename_value} COMMAND ${GPB_PYTHON${pyversion}_COMMAND} "${CMAKE_SOURCE_DIR}/autotests/pythontest.py" ${CMAKE_BINARY_DIR}/py${pyversion}) + if (GPB_SIP_DEPENDS MATCHES PyKF5) + set(_kf5_python_prefix ${CMAKE_INSTALL_PREFIX}/lib/python${pyversion${pyversion}_maj_min}/${GPB_INSTALL_DIR_SUFFIX}) + else() + set(_kf5_python_prefix ${CMAKE_BINARY_DIR}/py${pyversion}) + endif() + add_test(NAME Py${pyversion}Test${modulename_value} COMMAND + ${GPB_PYTHON${pyversion}_COMMAND} "${CMAKE_SOURCE_DIR}/autotests/pythontest.py" + ${_kf5_python_prefix} + ) install(DIRECTORY ${CMAKE_BINARY_DIR}/py${pyversion}/${pythonnamespace_value} DESTINATION lib/python${pyversion${pyversion}_maj_min}/${GPB_INSTALL_DIR_SUFFIX}) -- cgit v1.2.1