CMake is nice. Or not?
I am playing with CMake. Specifically, I am trying to replace the simplistic handmade Makefiles for my RA-Plugins project.
The parts about detecting libraries and conditionally compiling plugins based on what you have were surprisingly easy!
Until I ran into ... man pages.
Here is a Makefile that would build all the manpages for the plugins:
MANPAGES=plugins-ra.8 authchecks.8 rcptchecks.8 man: \$(MANPAGES) %.8: %.man.txt txt2man -t \${basename $< .man.txt} < $< > $@
As you can see... trivial. All I need to do in order to add a man page is add whatever.8 to the list, and it will be created from whatever.man.txt.
But... how does one do that using CMake?
I started thinking of using a FILE (GLOB *.man.txt) and then a FOREACH over that, and then... then what? Really, I am stumped. I am a newbie, though, and getting the big, difficult stuff done is enough to switch. I should generate these before distribution anyway.
So, I wrote a wee Makefile.manpages and added this for CMAKE:
ADD_CUSTOM_TARGET ( manpages make -f Makefile.manpages )
But I am curious about finding the cmakeish way.