Tremulous + CMake

CMake builds

This weekend I’ve finally got around writing a CMake build system for Tremulous. Unlike every other Quake3 fork which has done a this, ours is actually good. Anyone familiar with modding Tremulous previously would likely be aware of the monolith Makefile. Modders may also no be aware that it’s Just Wrong!

Build just the game

And now we can rebuild the game logic like so:

$ cd tremulous
$ cmake ..
$ gmake game game.qvm                                                                                                                                                       

Whats involved?

This system adds CMakeLists.txt files in more appropriate places, these files define how to build the code. The game code is compiled by the rules in src/game/CMakeLists.txt.

##src/game/CMakeLists.txt

#
##    ____                                      _      
##   / ___| __ _ _ __ ___   ___    ___ ___   __| | ___ 
##  | |  _ / _` | '_ ` _ \ / _ \  / __/ _ \ / _` |/ _ \
##  | |_| | (_| | | | | | |  __/ | (_| (_) | (_| |  __/
##   \____|\__,_|_| |_| |_|\___|  \___\___/ \__,_|\___|
##                                                     
#

set(QC_SOURCE_DIR ../qcommon)

add_definitions( -DGAME )

set( GAME_SOURCES
    g_main.c # Must be listed first!
    bg_alloc.c
    bg_lib.c
    bg_lib.h
    bg_local.h
    bg_misc.c
    bg_pmove.c
    bg_public.h
    bg_slidemove.c
    bg_voice.c
    g_active.c
    g_admin.c
    g_admin.h
    g_buildable.c
    g_client.c
    g_cmds.c
    g_combat.c
    g_local.h
    g_maprotation.c
    g_misc.c
    g_missile.c
    g_mover.c
    g_namelog.c
    g_physics.c
    g_playermodel.c
    g_public.h
    g_session.c
    g_spawn.c
    g_svcmds.c
    g_target.c
    g_team.c
    g_trigger.c
    g_utils.c
    g_weapon.c
    g_weapondrop.c
    tremulous.h
    ${QC_SOURCE_DIR}/q_shared.h 
    ${QC_SOURCE_DIR}/q_shared.c
    ${QC_SOURCE_DIR}/q_math.c
    )

add_library(
    game SHARED
    ${GAME_SOURCES}
    g_syscalls.c
    )

add_qvm(
    game
    ${GAME_SOURCES}
    g_syscalls.asm
    )

This is only available in our private repo for the time being.

5 Likes

explain how this utilization of CMake is better than those other crappy attempts (including that of U***********,1 which is just as crappy).

1 not the 3rd race mod

also explain how a build system as crappy as CMake is non-WRONG.

2 Likes

While I don’t necessarily think CMake is the best build system, it has benefits over a monolithic Makefile in that it has built-in platform independence. Worst case is it’s not an optimal build system for our project, but at least it’s a step in the right direction. There are a few other benefits as well, but I think this is by far the largest advantage to using a generated build system over a monolithic build system.

Lmfao, leave Unvanquished alone already.

So what’s the point in showing it off? It’s not even a feature an end-user will care about.

… Because the thread is relevant to it’s subcategory on the forum. Just because it isn’t released, doesn’t mean there’s no point in making a thread about it. Don’t derail this thread.

1 Like

Not possible, I believe all build systems are WRONG.

No

^ Nice try, but I actually like much of Unvanquished team has done.

i challenge ur claim: ur implementation using CMake is just as crap. want to argue otherwise ?

You’re probably right, but I accept your challenge.

i impatiently await ur arguments.

1 Like

^^ You can review it when the code is released and tell me what is crap :octopus:

1 Like