CMake revamp

Git branch.

Features

Simple setup
$ sh setup.sh
$ cd build
$ ninja install
Clean development install
$ cd ../install
$ ls 
base  docs  gpp  libs  server.sh.template  tools  tremulous  tremulous_server
Running servers is now simple
$ cd ../install
$ cp server.sh.template server.sh
$ gedit server.sh
$ sh server.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!

5 Likes

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

4 Likes

@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 ( https://github.com/GrangerHub/tremulous/releases ) 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).

2 Likes

Depends on what you need it for.

4 Likes

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

https://github.com/lamefun/tremulous/blob/cmake_revamp/data/game/pack_vms.py

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…

4 Likes

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”!

5 Likes

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

4 Likes

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] )

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

tremulous_build_game(
  <target-name>
  [NO_INTERFACE_11]
  [GPP_PK3 <pk3-name>]
  [V11_PK3 <pk3-name>]
  [DESTINATION <pk3-destination>]
  [INCLUDE_DIRECTORIES <dirs>]
  GAME_SOURCES <sources>
  CGAME_SOURCES <sources>
  UI_SOURCES <sources> )
5 Likes

@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.

4 Likes

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.

3 Likes

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.

3 Likes