Fun with Qt Help and CMake

As a Windows application, Deep Sky Stacker stores all its help text in .chm files, but I need to get rid of the Windows dependencies. Fortunately I have the HTML and images that make up those files, and there’s the Qt Help system that can repackage them for their help engine so I can in theory make it work on Linux/MacOS.

Generating the XML files to describe which files should be packaged up doesn’t seem to be a major issue, but actually creating the necessary files in CMake is more of a problem. Allegedly it can be done with some of CMake’s recent support for Doxygen, but documentation for that appears to be a little thin. If I’m honest, documentation for the entire Qt Help system looks a bit thin compared with other parts of the project. For the time being, I’ve resigned myself to the help files being built every time and using custom commands and targets.

I’ve also had to work around the restriction that whilst qhelpgenerator can produce the .qhc files in the build directory structure, the .qch files seem to get a filename that’s generated by removing the .qhcp extension from the input file and adding the .qch extension whilst preserving the original pathname. Whether the program is run in the build directory tree or the source directory tree, the .qch file ends up in the source tree because that’s where the .qhcp file is. Copying the .qhcp file to the build tree doesn’t work either because all the HTML and image files are still in the source tree and can’t be found.

In the end I resorted to the following mess in CMakeLists.txt:

For brevity, create a couple of variables pointing to where the command is run and where the source files are:

set( cwd ${CMAKE_CURRENT_SOURCE_DIR} )
set( bin ${CMAKE_CURRENT_BINARY_DIR} )

Then create a glob containing the names of all the files that should cause a rebuild of the help files:

file(GLOB EN_DEPS
    english/*
    images/*.*
    images/Theory/*.*
    images/english/*.*
)

Use a custom command to run qhelpgenerator and move the .qch from the source tree back into the build tree:

add_custom_command (
  OUTPUT dsshelp-en.qhc dsshelp-en.qch
  COMMAND qhelpgenerator ${cwd}/dsshelp-en.qhcp -s -o dsshelp-en.qhc
  COMMAND mv ${cwd}/dsshelp-en.qch ${bin}
  DEPENDS ${EN_DEPS}
  COMMENT "Generating English help files"
)

And finally add a target that triggers the custom commands:

add_custom_target ( helpfiles ALL DEPENDS
  dsshelp-en.qhc
)

It’s really not pretty, but it seems to do the job. The worst bit is having it happen every time regardless of whether the files have been updated or not. As I have six different languages to cater for it would be nice to create a macro that makes adding a new one somewhat simpler too, but that can wait for another day.

Posted in Computing, Linux | Tagged , | Leave a comment

Memory Lane, 25th May 2022: A failure

Germination of squash plants always seems to be a bit random so I always sow far more than I need. Then when I get more plants than I want I can’t really bear to throw them into the compost. This year I thought I’d make a new no-dig bed around a walnut tree and put the spare squashes into the bed:

It was a sorry failure, sadly. The plants just never really took off. I don’t know if there was too much shade from the tree or if it was something else, but they didn’t produce any fruit.

I’m not giving up on the “bed round a tree” idea though. It makes mowing easier, especially if I put a woodchip border around the bed. Perhaps I just need to change the type of plant.

Posted in Smallholding, Veg plot | Tagged | Leave a comment

Memory Lane, 24th May 2022: Make room! Make room!

Thanks to needing more compost for the whole no-dig process, and attempting to compost more material, it was becoming obvious that my three compost bays just weren’t sufficient. I’d also decided that I should have a more organised process for composting too, in that although it’s not necessary it does help on the scale that I work at to turn the compost at some point, usually late Autumn.

I decided that if I had five bays then starting with them all empty I could begin by filling the second bay from one end, then third and so on down the line. If I additionally made the bay dividers removable then in the Autumn I could remove the divider between bays one and two to make it easier to move the compost between then, replace it once everything was moved, then remove the next one and so on.

Finally, to stop it all getting wet and soggy during the winter a roof would be ideal, and as it happened I had some old wrinkly plastic roofing lying about that once upon a time I used as cloches.

The walls of the existing bays were made of corrugated sheet and there were enough internal ones to extend the external walls if I removed them. I made new inner walls from scrap decking. Here I’m halfway through the job. I must have a photo of it all completed somewhere. Doubtless it will turn up later.

The new front and rear posts I bought in the right sizes and I had a couple of spare tall posts that could replace two of the existing shorter front ones, those replaced ones being subsequently bolted onto the remaining short ones to make them taller.

Posted in Smallholding, Veg plot | Tagged | Leave a comment

Memory Lane, 24th May 2022

Just a quick shot of the veg plot in late Spring. Most exciting are the asparagus plants in the closest bed producing their first ever shoots. This year they need to be left for the plants to develop. It’ll be a couple of years before we can really take a decent harvest. I marked each plant with a plant label so I could see where I was expecting them to come up, but I was still so pleased when all thirty of the crowns I’d planted produced shoots.

Posted in Smallholding, Veg plot | Tagged | Leave a comment

Practice is the key…

Ages back I decided that I was going to try to teach myself to play piano. Sadly it all fell by the wayside for reasons I don’t really understand. Possibly the lack of progress to a standard where it became possible to play something vaguely interesting just got to me in the end.

Giving up isn’t really in my nature however (my wife describes it as “being stubborn” :D), so last October I started again and was doing rather better until early December when I (and my daughter oddly enough) caught some sort of infection that affected our inner ear and sense of balance which really messed me up a fair bit. It was rather like being very drunk, but without the expense and the hangover. It was very strange for a while. I recall at one point standing at the top of the stairs and being unable to work out how to get down them in the full knowledge that if I tried to step down normally I’d end up in a heap at the bottom.

Then in the latter half of January I developed a quite unpleasant case of cellulitis that has taken a while recover from fully, but now I’m ready to go again so I’ll take a few steps back and try to pick everything up as quickly as possible.

Posted in Learning piano | Leave a comment

A job-hunting I shall go…

The time has come. I really need to sort out getting a new job now. I’ve not done any full-time paid work for ages and whilst I’ve achieved an awful lot with the time I’ve had free, the mortgage has to get paid somehow. I don’t think there’s been a single day when I didn’t actually achieve something, often several things, other then when I’ve been ill. That’s over a thousand consecutive days without ever once saying “I just can’t be bothered today. I’m going to veg out and do nothing.”

It’s a bit odd, having to write a CV at this point. I’ve done all sorts of programming and systems admin work over the last twenty years for dozens of clients and it’s all been word-of-mouth. I don’t think I’ve written a CV or that anyone has asked to see one in at least twenty years. Then I’m told I’ll need to put stuff on Linked-In. The horror.

So, if anyone knows of UNIX/Linux-based systems admin or coding work where working from home is possible, by all means get in touch. Something that relates to the environment or that directly helps to improve peoples’ lives would be a bonus. However, moving for work just isn’t feasible in the short term. We have two elderly parents who share our home and are in quite poor health. Trying to move them now, even assuming we could find somewhere suitable, would probably kill them, quite literally.

Posted in Computing, Random | Leave a comment

No dig diary, 12th February 2024

Running out of heated propagation space is starting to look inevitable, so today I have cleared some space in the house for my “backup” propagators. One of them is definitely looking rather sad and could really do with a replacement cover, but I suspect as it’s so old any replacement might not fit correctly. An alternative might be to buy a new propagator, but I’m thinking that for little more than the cost of a new one I could buy a soil heater cable and build a permanent one in the greenhouse that would hold five times as many module trays. It’s a very tempting idea.

Once the propagators were sorted I got another bed’s worth of weeding done in the veggie plot, so that’s three and a half down, four and a half to go now.

Posted in Smallholding, Veg plot | Tagged | Leave a comment

Memory Lane, 11th May 2022: Wax on, wax off

My bee shed needed to move so I’ve been pulling together everything that was in it. I’m mostly using starter strips and unwaxed frames now, so I’m not entirely sure what to so with this lot, that is “some of” the wax I’ve recovered from old frames over the last ten years or more. Turning the wax in for more foundation or credits towards other purchases isn’t really looking like that great a deal either. Ideas on a postcard…

Posted in Bee-keeping, Smallholding | Tagged | Leave a comment

No dig diary, 11th February 2024

I had to go out and do some weeding today. The state of the veg beds was quite distressing, with Hairy Bittercress like this:

and sycamore seedlings already out of the ground and growing away.

I managed to get two and a half beds done, dodging rain showers, and in fact when the Sun came out it was so pleasant just being outdoors. I didn’t have the heart to dig these up though.

On the positive side, the PSB is finally producing heads. Last Winter we were eating it from November and by mid-February many of the plants were all but over, but this time it has taken so long to be ready. I’m guessing because the second half of last year was quite dull and wet.

I guess that means we could end up with a glut over the next few weeks. Not that it would be a hardship.

I also sorted through some carrots that the mice have found. They were stored in trays of compost on top of a table so I’m not sure how they managed it, but clearly they found a route up somehow. I’ll need to find a better solution for next Winter.

Posted in Smallholding, Veg plot | Tagged , | Leave a comment

Memory Lane, 5th May 2022

This is the first pineapple plant that actually survived when I tried to get it to produce roots in a jar of water, one year on.

I suspect it has split into three separate plants, but information about pineapple propagation beyond actually getting them to produce roots seems to be rather more sparse. It’s going to go into the ground in Frankenstein’s Greenhouse anyhow. If it survives there then great. If it doesn’t then trying to keep it alive is perhaps not the best use of my time. Even so I’ll be glad that I tried it, just for the experience of having got new plants to grow.

Posted in Smallholding, Veg plot | Tagged | Leave a comment