New: KPropertyAddQCH.cmake for creating an API dox QCH file during the build
ClosedPublic

Authored by kossebau on Nov 26 2016, 1:04 PM.

Details

Summary

Custom copy of upcoming ECMAddQCH.cmake, see https://phabricator.kde.org/D2854
for existing issues and open questions.

Test Plan

KPropertyCore.qch generated by this: https://share.kde.org/index.php/s/y8s0oAkxUNc1dXl
KPropertyWidgets.qch generated by this: https://share.kde.org/index.php/s/anNMRKLBGDxTSPe

Diff Detail

Repository
R13 KProperty
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau updated this revision to Diff 8532.Nov 26 2016, 1:04 PM
kossebau retitled this revision from to New: KPropertyAddQCH.cmake for creating an API dox QCH file during the build.
kossebau updated this object.
kossebau edited the test plan for this revision. (Show Details)
kossebau added reviewers: KProperty, staniek, piggz.
kossebau added a project: KProperty.
staniek edited edge metadata.Nov 27 2016, 9:53 PM

Good start. Runs flawlessly.

CMakeLists.txt
34

ON by default? I am wondering about overhead.

staniek requested changes to this revision.Nov 27 2016, 10:08 PM
staniek edited edge metadata.

Side-by-sided install-ability would require this:

--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -263,9 +263,9 @@ endif()
 
 if(BUILD_QCH)
 kproperty_add_qch(
     KPropertyCore_QCH
-    OUTPUT_BASENAME KPropertyCore
+    OUTPUT_BASENAME ${KPROPERTYCORE_BASE_NAME}
     VERSION ${PROJECT_VERSION}
     ORG_DOMAIN org.kde
     SOURCES
         Mainpage.dox
@@ -293,9 +293,9 @@ if(KPROPERTY_WIDGETS)
         set(_KF5WidgetsAddons_QCH KF5WidgetsAddons_QCH)
     endif()
     kproperty_add_qch(
         KPropertyWidgets_QCH
-        OUTPUT_BASENAME KPropertyWidgets
+        OUTPUT_BASENAME ${KPROPERTYWIDGETS_BASE_NAME}
         VERSION ${PROJECT_VERSION}
         ORG_DOMAIN org.kde
         SOURCES
             ${kpropertywidgets_HEADERS}
CMakeLists.txt
34

BTW, what's the default for KF5 for example?

This revision now requires changes to proceed.Nov 27 2016, 10:08 PM

This may be not the core topic here but any ideas to improve these glitches in Assistant?

kossebau updated this revision to Diff 8559.Nov 27 2016, 11:49 PM
kossebau edited edge metadata.

use ${KPROPERTY*_BASE_NAME} for the QCH OUTPUT_BASENAME argument

This may be not the core topic here but any ideas to improve these glitches in Assistant?

It could be improved by building Qt Assistant not only with QTextBrowser, but instead with QtWebKit. Sadly there seems no option yet for QtWebEngine, only some patch for Qt Creator with that.
See issues listed at end of Summary for https://phabricator.kde.org/D2854. It is a hen & egg problem sadly. My hope is by having finally more 3rd-party QCH there will be more interest/pressure to fix both Doxygen to create JavaScript-less QCH files and/or the QCH viewer to be provided with not just QTextBrowser given the existing QCH files.
If everyone just waits until things work properly, nothing will happen in any case. At least I already got one fix into development branch of doxygen...

CMakeLists.txt
34

The overhead currently is pretty small from what I experience. On my machine (SSD) the QCH generation feels to take a similar long time as an .o file generation.
Currently the macro will be a noop if the needed tools are not found, only emit a warning and otherwise proceed.
I proposed ON to push things so packagers/self-builders might notice the QCH feature at least by the warnings in the cmake log.
If you see OFF as default fit more people doing builds of KProperty & Co., your choice. As QCH interested person I hope for some special notes in the release notes in any case :)

The current patches for KF5 also use ON as default (cmp. https://phabricator.kde.org/D3458, https://phabricator.kde.org/D3439, https://phabricator.kde.org/D3438), just nobody has yet started to review and give feedback, so currently lack of further opinions.

staniek requested changes to this revision.Nov 28 2016, 8:09 AM
staniek edited edge metadata.

OFF please here. And if @piggz agrees for KReports as well.

CMakeLists.txt
34

OK, I am thinking about OFF as the default. We never know what's the reason of building: preparing package is only a tiny fraction of cases, actually one of the last. We never know if people prefer HTML of PDF docs. During development generating anything for every build is costly. I would say we can equally well document a note that developers can set to OFF but in real world there are more developers than packagers, so I believe it's somewhat better to say packagers to set it ON in README.PACKAGERS.

This revision now requires changes to proceed.Nov 28 2016, 8:09 AM
kossebau updated this revision to Diff 8565.Nov 28 2016, 12:24 PM
kossebau edited edge metadata.

default to OFF, use simple_option, avoid warning noise if set to OFF

staniek requested changes to this revision.Nov 28 2016, 12:28 PM
staniek edited edge metadata.

Almost there, thanks.

src/CMakeLists.txt
265

Can we indent the entire block?

293

Can we indent the entire block?

This revision now requires changes to proceed.Nov 28 2016, 12:28 PM
kossebau updated this revision to Diff 8576.Nov 28 2016, 7:01 PM
kossebau edited edge metadata.

indentation, improvements to finding tools/data, fix target variable

staniek accepted this revision.Nov 28 2016, 7:55 PM
staniek edited edge metadata.

Good job, thanks.

BTW, would it work on Windows?

This revision is now accepted and ready to land.Nov 28 2016, 7:55 PM

BTW, would it work on Windows?

I am not aware of anything that would prevent this, but cannot test that.

kossebau updated this revision to Diff 8584.Nov 29 2016, 1:00 AM
kossebau edited edge metadata.

workaround cmake_parse_arguments not defining variables for empty multi-var arguments

This revision was automatically updated to reflect the committed changes.