[xiphos-devel] CMake port

dominique at corbex.org dominique at corbex.org
Mon May 14 12:37:23 MST 2018


On Mon, 14 May 2018 08:53:39 -0400
Karl Kleinpaste <karl at kleinpaste.org> wrote:

> I'll read the new install docs soon, but could you provide a
> straightforward configure/build example or two, just to give us
> something to run with? How is the win32 build?

Hi Karl,

yw,

Here is an example for building Xiphos with CMake on Fedora:
$ mkdir build  # whenever you want, I usually do it in xiphos root dir
$ cd build
$ cmake --DGTKHTML=ON ..
$ make -jn
$ make install

The default build type is 'Debug' if a .git dir exists, it is 'Release' otherwise.
If you want to specify a specific build type, run:
$ cmake -DCMAKE_BUILD_TYPE=Release -DGTKHTML=ON ..

The default install dir is /usr/local, if you want /usr, run:
$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DGTKHTML=ON ..

There is also a .spec file in cpack/fedora.


Another example for creating DEB packages:
$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DWEBKIT1=ON ..
$ make package -jn
You'll find the new DEB packages in your build dir. It should work on
any linux host but it will produce better deb packages when Debian
specific tools ‘dpkg-xxx’ are usable on the build system.
*So the good news is that we don't need the debian/ dir anymore.*


An example for building a Windows EXE file, in a fresh build dir:
$ cmake -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw64.cmake
-DGTK2=ON .. 
$ make package
After some time, you'll find a xiphos-4.1.0-win64.exe in your build dir.
The Help files are compiled with chmcmd, from mallard files converted
into html with yelp-tools. CMake generates the NSIS installer.


For upgrading to a new version of Xiphos:
Edit the main CMakeLists.txt and change line 25 from
### set project name and version HERE ###
project (xiphos
  VERSION "4.1.0"
  LANGUAGES C CXX)
to:
### set project name and version HERE ###
project (xiphos
  VERSION "4.x.x"
  LANGUAGES C CXX)
All other files are upgraded accordingly, release date is taken from
the ChangeLog file timestamp.


Use Ninja for building Xiphos ~20% faster:
$ cmake <options> .. -G Ninja
$ ninja
$ ninja install
Actually, ninja will first complain about multiple targets creating
*.po files, in fact, I used an internal name for naming the target I
inserted for updating *.po files. I'll fix this ASAP.


Dom
-- 
dominique at corbex.org <dominique at corbex.org>



More information about the xiphos-devel mailing list