CMake revamp

Git branch.


Simple setup
$ sh
$ cd build
$ ninja install
Clean development install
$ cd ../install
$ ls 
base  docs  gpp  libs  tools  tremulous  tremulous_server
Running servers is now simple
$ cd ../install
$ cp
$ gedit
$ sh
What needs to be done
  • Need to add Windows and macOS support.

  • Need to figure out how to best bypass packaging pests (most people call them “distributions”, but they don’t deserve this name since the only thing they are is a roadblock between the developers and the users).

  • Maybe get rid of Python 3 dependency? Everything I use Python 3 for can be done with plain CMake, but in a less clean way. Should I keep the dependency or get rid of it?

Rant about [color=#ff0000]git[/color]

Here’s some more nice info about [color=#ff0000]git[/color] :japanese_goblin: “usability”. When you add a [color=#ff0000]git[/color] submodule :woman_mechanic:, it creates a .gitmodules file :man_firefighter:. Basic logic :thinking: dictates: the git submodule add is just a way to add to that file :man_farmer:, and since there’s no git submodule rename :writing_hand:, the way to rename a module is to edit .gitmodules and run git sumbmodule update :owl:. However, it fails with no error message if you edit the file :zipper_mouth_face:, and does absolutely nothing :snail:. I had to search for the solution :triumph:, and found nothing obvious :speech_balloon:, so I had to remove it and re-add the submodule :man_facepalming:.

This is why people like to use from [color=#00ff22]APPLE®[/color], they think PEOPLE!


@dGr8LookinSparky @romdos I need advice: is it OK to depend on Python 3 for build scripts?


@lamefun , @blowFish (aka wtfbbqhax) is the one to talk with about the build system. He worked on the current build system, getting it to work for 32bit/64bit WIndows, 64bit linux, and 64bit macos. He also setup the system to have travis-ci to automatically build for those platforms to confirm that those builds pass, and that releases those binaries on our releases page ( ) whenever we push a new release tag, which is then also used as part of the update system (not yet fully functional in the client, but the client does check and notify if it is up to date with the latest release).


Depends on what you need it for.


To package stuff. CMake can do it itself, but it’s quite ugly.

Also, should I try using things like CMake Hunter or Conan or simply continue to bundle dependencies? I’ve been looking into them and they all seem to have missing/outdated/poorly-maintained packages…


So I wanted to see if I can create a Docker setup for my new build system… and found that it’s impossible to make heads and tails of the documentation… I’ve got a new conspiracy theory: they make incomprehensible documentation on purpose, to sell “training”!


I’m a long time fan of Docker and containerization, and already provide an environment for Tremulous development and release deployment. You can build it yourself from scratch via the Dockerfile in the repo, or you can pull my hosted solution from Docker hub like so:

docker pull wtfbbqhax/tremulous

It’s based on Ubuntu release Yakkety

Docker Hub (see tags, yakkety)

– hope this helps


So this is taking longer than I anticipated, mainly because I want to do this properly and am researching the best and most modern ways of doing stuff (and mostly failing, because there’s rarely any good standard solution in C++ world :frowning:). Also, I plan on providing tools to help automate package creation like this:

find_package( Tremulous COMPONENTS <components> [REQUIRED] )

  OUTPUT <name>
  [FILES <files>]
  [DIRECTORY <path> FILES <files>]
  [FILE <name> [SUBDIR <subdir> | AS <name>]] )

  [GPP_PK3 <pk3-name>]
  [V11_PK3 <pk3-name>]
  [DESTINATION <pk3-destination>]
  GAME_SOURCES <sources>
  CGAME_SOURCES <sources>
  UI_SOURCES <sources> )

@lamefun, you should take a look at my latest development branch game_lua which drops the requirement to build QVM’s. Dropping this dependency will likely make the portable CMake build much easier.

PS: You should also join our Slack community so we can adequately communicate.


Notes to @lamefun who’s been AFK,

I’ve been working on fixing the existing CMake for VS2017 generation

So far, I’ve been using Hunter (as you’ve linked above). Unfortunately Hunter it is not CI friendly building from scratch with curl alone takes almost 2 hours. However, it seems to work well, and if nothing else is nice to lean on for fixing the windows issues. It might be possible for us to cache this somehow.


Yeah windows issues are a problem. My windows 10 system took so long to get operational I only really play trem on my better linux laptop.