Jump to content
The Dark Mod Forums

New CMake build scripts for DarkRadiant


vlad

Recommended Posts

I've just written CMake scripts to build DR under Linux.

 

I think CMake is more useful than Autotools.

These scripts make a 'standalone' build of DR, you don't need to install DR, for example, in /usr/local.

 

Here is the patch:

http://depositfiles....files/xb0fde4ei

 

Modified at 29 May 2010: Now you don't need to set LD_LIBRARY_PATH to run DR

 

How to build:

 

1. Make an empty build directory and chdir to it:

 

mkdir dr-build

cd dr-build

 

2. Run cmake and set your installation prefix:

 

cmake -DCMAKE_INSTALL_PREFIX=/home/vlad/dr_inst <darkradiant-source-root>

 

3. make install

 

4. enjoy;)

Edited by vlad
Link to comment
Share on other sites

Nice. That would make it a lot easier to deal with than installing it under /usr. At least once a year I do a full clean system install, usually with each major release of Mandrake. As such I format / and /usr when that happens. This will make (pun intended) for one less program to reinstall after doing so.

I prefer make to copy the files for installation so everything gets where it needs to go. I could manually copy everything to a directory in /home/me after running make, but I hate sorting through the source to get the files I really need.

System: Mageia Linux Cauldron, aka Mageia 8

Link to comment
Share on other sites

I won't try to argue which is better out of Automake or CMake, since I have never used the latter, but I should point out it is perfectly possible to install DR into other locations using the --prefix argument to configure, e.g.

 

$ ./configure --prefix=/opt/darkradiant

Link to comment
Share on other sites

I won't try to argue which is better out of Automake or CMake

[/code]

 

As for me, there are some advantages:

1. It doesn't change the working copy; it doesn't generate files in working copy.

2. It compiles dm_editing plugin ;). Some months ago I tried to compile dm_editing, but there were some error messages.

3. Its syntax is simpler.

 

I should point out it is perfectly possible to install DR into other locations using the --prefix argument to configure, e.g.
$ ./configure --prefix=/opt/darkradiant

 

That's good! I didn't try it before, because I supposed that DR needs its libs and files to be located in directories like /usr/local/share etc. Now I confirm that it works with custom prefix, but why it doesn't compile dm_editing?

Link to comment
Share on other sites

As for me, there are some advantages:

1. It doesn't change the working copy; it doesn't generate files in working copy.

 

So does automake, provided you write the scripts correctly (which I believe is the case for DR).

 

$ cd /tmp
$ mkdir dr-build
$ cd dr-build
$ /home/myself/darkradiant/configure --prefix=/opt/darkradiant
$ make

 

All build files will now be placed in /tmp/dr-build (i.e. the directory you are in when you run configure).

 

2. It compiles dm_editing plugin ;). Some months ago I tried to compile dm_editing, but there were some error messages.

 

It should compile dm_editing, but I haven't got round to fixing it all up so that it works. I should take another look at this soon.

 

3. Its syntax is simpler.

 

I won't argue with this, the M4 macro language isn't all that user-friendly.

Link to comment
Share on other sites

So does automake, provided you write the scripts correctly (which I believe is the case for DR).

 

$ cd /tmp
$ mkdir dr-build
$ cd dr-build
$ /home/myself/darkradiant/configure --prefix=/opt/darkradiant
$ make

 

All build files will now be placed in /tmp/dr-build (i.e. the directory you are in when you run configure).

 

 

That's true, but I have to run autogen.sh before building DR. Otherwise, 'make' command doesn't work, it can't find some files.

This script modifies all Makefile.in, configure and other generated files.

Link to comment
Share on other sites

That's true, but I have to run autogen.sh before building DR. Otherwise, 'make' command doesn't work, it can't find some files.

 

That shouldn't happen, it sounds like a bug in the build scripts. Can you post the exact error you get when you do this?

Link to comment
Share on other sites

That shouldn't happen, it sounds like a bug in the build scripts. Can you post the exact error you get when you do this?

I don't think so.

I think that different versions of autotools aren't fully compatible with each other: they behave differently and make slightly different files.

 

I'll post this error tonight.

Edited by vlad
Link to comment
Share on other sites

I think that different versions of autotools aren't fully compatible with each other: they behave differently and make slightly different files.

 

True, but this should only apply when generating the buildscripts with autoconf/automake. Once the scripts are generated, it should be possible to build on any platform using ./configure && make && make install without even having autotools installed.

Link to comment
Share on other sites

True, but this should only apply when generating the buildscripts with autoconf/automake. Once the scripts are generated, it should be possible to build on any platform using ./configure && make && make install without even having autotools installed.

 

vlad@vladhome:~/aaa/gitrepos/dr-build> env LANG="C" make

CDPATH="${ZSH_VERSION+.}:" && cd ./../darkradiant/darkradiant && /bin/sh /home/vlad/aaa/gitrepos/darkradiant/darkradiant/missing --run aclocal-1.11 -I m4

aclocal-1.11: couldn't open directory `m4': No such file or directory

make: *** [../darkradiant/darkradiant/aclocal.m4] Error 1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...