Building/Configuring with CMake
Posted: 4. Apr 2014, 22:27
I'm just getting into slkbuilds, but so far they seem pretty straightforward. That said, configuring programs built with CMake is tripping me up. So far, this is holding me up from releasing packages for Guayadeque (an excellent lightweight but feature-rich media player) and an updated Whisker Menu (what can I say? I really wanted the custom menu support
). The ones I've built for myself are definitely not ready for primetime.
I think I've found CMake variables that correspond to all the required configure script options except one. Here are the original ones for quick reference.
And here are the ones that seem to correspond in CMake after scouring the CMake Wiki, a few slkbuilds (thanks djemos!) and the rest of the internet for documentation:
So now two questions arise. First off, do I actually have to set LIB_SUFFIX in order to set LIB_INSTALL_DIR properly? This doesn't seem to be the case with Make, but I admittedly know little about CMake or build systems in general at this stage.
Second, you'll notice above that I can't seem to find any variable that corresponds to the localstatedir option. Anyone know of a viable equivalent for CMake? It's not in their documentation that I can find, so I'm not too optimistic that that it's particularly straightforward to come up with an equivalent in CMake.
I'd appreciate any input, including on whether I'm getting too pedantic here. I notice that not all slkbuilds for available packages, even in the official repos, cover all of the necessary variables, but I'd at least like to get this stuff down both for the sake of thoroughness and my own curiosity.

I think I've found CMake variables that correspond to all the required configure script options except one. Here are the original ones for quick reference.
Code: Select all
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--localstatedir=/var \
--sysconfdir=/etc \
--mandir=/usr/man
Code: Select all
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DDLIB_INSTALL_DIR:PATH=/usr/lib${LIBDIRSUFFIX} \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
-(localstatedir variable)
-DSYSCONF_INSTALL_DIR:PATH=/etc \
-DMAN_INSTALL_DIR:PATH=/usr/man
Second, you'll notice above that I can't seem to find any variable that corresponds to the localstatedir option. Anyone know of a viable equivalent for CMake? It's not in their documentation that I can find, so I'm not too optimistic that that it's particularly straightforward to come up with an equivalent in CMake.
I'd appreciate any input, including on whether I'm getting too pedantic here. I notice that not all slkbuilds for available packages, even in the official repos, cover all of the necessary variables, but I'd at least like to get this stuff down both for the sake of thoroughness and my own curiosity.