Qt, cmake and qhelpgenerator

906 Views Asked by At

Is there any automatism in cmake to run qhelpgenerator and get out of it the compressed manual to be included in the executable?

cmake already takes care of a lot of things. As an example, resources files (.qrc) are gracefully handled by adding them to the list of source files of a project. The same applies for the moc generated by qmoc and so on.
I was wondering if there exists something similar to elaborate automatically .qph files. So far, I only found online projects that use custom targets to run qhelpgenerator and set dependencies between targets.
It isn't a problem for itself, I want only to know if there exists a nicer way to do it. That's all.

2

There are 2 best solutions below

0
Craig Scott On BEST ANSWER

(Turning comment into answer)

The upcoming CMake 3.9 release has upgraded support for doxygen. It will provide a new doxygen_add_docs() function which makes running doxygen trivial and doxygen has direct support for running qhelpgenerator and friends. You just need to set a few doxygen-specific variables like DOXYGEN_GENERATE_QHP and then call that function (prefix each of doxygen's variables with DOXYGEN_ to set them in CMake). The function takes care of setting up all the custom target gadgetry.

0
arrowd On

KDE's Extra CMake Modules project contains a CMake module for this. This modules implements .qhc generation with a macro, because, I think, there are too many tweaks and options can be set. Just look at ecm_add_qch signature. Not to mention linking qchs together and exporting targets for use from another CMake project.