This is work in progress - right now there seem to be very different views about how runtime dependencies for projects should be handled. This is much more of a problem for Python projects because almost all of their dependencies are runtime only.
Here are some links to discussions:
There is not much that needs to be compiled for a Python project:
from PyQt4 import uic uic.loadUi('mywidget.ui')
So you need a Python interpreter installed for the generation of byte-compiled *.pyc files. Make sure it is a version that can also execute your program. If the version installed at the client side is too different, your precompiled bytecode is incompatible and cannot be used, so the client system will recompile your sources. And if it cannot write them because of missing access rights, it will do that at every program start (there are ways how to tell python where to write its local *.pyc files but that is out of scope for here).
And optionally you need pyuic4 installed. This macro calls pyuic4 and installs the resulting *ui.py files:
PYKDE4_ADD_UI_FILES(src/*.ui)However I believe I had some problems with that macro, that may have been one reason why I now do that at runtime for Kajongg. This would need to be checked.
In C/C++ most runtime dependencies are also build time dependencies - the KDE4 cmake macros do not even let you differentiate them (yet). However Python source code can be bytecompiled without the imported modules being installed - so the set of build time dependencies is very small and about the same for all Python projects.
Most distribution packagers do NOT want cmake to error out on missing runtime dependencies, they do not even want warnings about them because they just might not want to install them. They want to have their build system as simple (and as fast) as possible with a minimal set of dependencies. However this is not true for all packagers, some do want warnings. Developers probably want warnings too but it should be a small burden for them to install what the program claims as missing.
Until an easy way is found to satisfy both use cases, it is probably best to only implement the least common denominator: Do not error out or produce warnings.
Of course packagers still need to know the runtime dependencies. For now there is no nice way of specifying this with existing cmake macros. Currently the best solution for you is to write runtime dependency information into a file README.packagers in the home of your project.
In theory, the main.py (like kajongg.py in the example below) could directly be installed in whatever */bin directory but it is nicer to only put a symbolic link there like /usr/bin/kajongg -> /usr/share/kde4/apps/kajongg/kajongg.py.
Of course cmake comes with a macro for this: