CMake and GNU Gettext

I wanted to add translation support to my personal project using CMake and Gettext. CMake itself contains a module to find and work with Gettext translation files. It looked simple, but not everything goes according to plans.

It is always easy to blame someone else. I got confused by different examples. First example showed a file structure as locale/${language}/MyApp.po, which failed me when I was trying to integrate it into my program. This in combination with me playing with it cause the CMake generation fail in error basicaly saying The target with the name "MyApp" already exists.. That is because the basename is the same between multiple languages.

Second example is showing a different file folder structure locale/${language}.po. This one worked like a charm, but it looks ugly, I wanted the first variant and was keeping at it for hours to give up in the end.

A short note on my failure to realize that I should debug the CMake itself instead of blindly searching online for hours without a proper solution since there is not that much information online, which means it either others are much smarter than me or that this is underused module / feature in CMake.

Articles from blogs I follow:

The RSS feed has been split into two new, this one is no longer maintained!

This RSS feed is no longer maintained. You can find the links for the two new feeds at: https://unixdigest.com/feeds.html

via unixdigest.com March 22, 2026

GPG Update 2026

A recent toot of mine got the response “friends don’t let friends use GPG” which, I suppose, is true enough. It certainly isn’t the attestation-friendly thing to use, and the opsec failures that are so easy with GPG-encrypted mail make it a hazard there. …

via [bobulate] February 3, 2026

Steve Ballmer was an underrated CEO

There's a common narrative that Microsoft was moribund under Steve Ballmer and then later saved by the miraculous leadership of Satya Nadella. This is the dominant narrative in every online discussion about the topic I've seen and it's a commo…

via danluu.com October 28, 2024

Generated by openring