Cross Platform Build system

ZOSS General Architectural, Design and Development discussions
Forum rules
Stick to the subject of the post. Your response will appear instantly, unless you have angered my spam filter, which will hold your comment until I approve it. Do not repost; I'll approve or delete your comment at my convenience. Comments are the responsibility of commenter. Allowing comments to remain does not constitute my endorsement of or responsibility for any comment's subject matter. My philosophy is: when in doubt, leave it in. However, I will delete your comment if is blatantly self-serving and promotional or if it is outright spam. If you really want to promote yourself, contribute something of value to the conversation.

By leaving comments here, you are agreeing to these terms; If you do not agree with these terms, do not leave a comment.

Cross Platform Build system

Postby Tony Richards on Mon Aug 31, 2009 8:13 am

This weekend I spent most of the weekend finishing off what Joker, GwynWynn, hatboyZero, etc had started with CMake.

I'm not 100% done, but my new approach will make it so that the CMake build will never get out of sync with the source code unless we add new libraries or plugins.

I've added a new command to zpkg:

Code: Select all
zpkg build generate C:\dev


This will go through all of the Zen projects and construct a CMakeFiles.txt from a CMakeFiles.template. The template has a couple of macros that expand into the groups and source for the project.

This way, if someone is using an IDE and adds (or removes) source files to the project and forgets to modify the CMake file, no harm done. The CMakeFiles.txt will be correctly generated the next time you run CMake.

Here's how I'm doing it on Windows.

In C:\dev\build (notice it's not in C:\dev\Zen\build), I run the following:
Code: Select all
C:
cd \dev\build
set PATH=%PATH%;C:\dev\tools\svn;C:\dev\dependencies\Lua
CMake C:\dev\Zen\build\CMake


You can specify additional parameters in CMake to tell it what compiler / IDE you want to use.

This will find the dependencies and generate a .sln and .vcproj (or Makefile or whatever, depending on your platform).

For plugins, if it doesn't find the dependency required for the plugin (Newton for ZNewton, Ogre for ZOgre, etc) then it will not generate the project for that plugin. You'll get some messages in the CMake output that will indicate what it couldn't find.

CMake will automatically call zpkg to generate the CMakeFiles.txt, so you don't have to run that manually.

When you update from SVN or you get a new source code drop, execute the CMake command again. Subsequent executions will execute faster and will update the build files based on whatever has been modified, correctly adding and removing files from the projects.

Personally, I have batch files / shell scripts that do svn update on all of the directories, and then executes CMake to update the projects. This gets my working copy up to date with the latest source files and build projects / makefiles and I'm ready to resume development.

This is going to save huge amounts of time because during the week I normally program using MSVC8 and weekends I use C::B on Linux. I spend an hour or more twice a week just getting the projects corrected when I switch platforms, and now we don't have to do that anymore. :P

At any rate, this means I didn't get much done on World Builder this weekend, but I believe we're a lot better off with this build system and it was worth the time and effort we put into it.

I'm not 100% complete yet, but it's far enough along that I can probably get someone else to pitch in and help. The base frameworks and most of Zen Studio are done, but the examples, tutorials, and many of the plugins are not done yet. Any volunteers? :mrgreen:

I've not merged this into trunk yet, so let me know if you want to play with it and I can give you the branches where it's located.

Thanks to Joker, GwynWynn, hatboyZero, and everyone else who dove into making Zen cross platform.

Enjoy!
Image
Tony Richards
 
Posts: 509
Joined: Thu Nov 15, 2007 6:52 pm

Re: Cross Platform Build system

Postby Captain Thomas on Fri Sep 18, 2009 1:35 pm

I think I am ready to try my hand at some plugins - do you have something that would be relatively simple to start out with? I will be working with C::B in Linux.
Captain Thomas
 
Posts: 65
Joined: Thu Oct 23, 2008 9:53 pm
Location: Tacoma, WA, USA

Re: Cross Platform Build system

Postby hatboyzero on Tue Nov 03, 2009 10:15 pm

Tony,

FYI, just finished getting the CMakeLists.template files and associated updates to zpkg.lua and the top level CMakeLists.txt file done for the Tutorial projects -- they should compile cleanly. Let me know if you have any problems with them...
Image
hatboyzero
Journeyman
 
Posts: 115
Joined: Wed Mar 26, 2008 8:32 pm
Location: Oxford, MS

Re: Cross Platform Build system

Postby Tony Richards on Wed Nov 04, 2009 7:52 am

Thanks, I'm testing now.

I've not recently tested execution on Windows... were you able to make sure these executed?
Image
Tony Richards
 
Posts: 509
Joined: Thu Nov 15, 2007 6:52 pm

Re: Cross Platform Build system

Postby hatboyzero on Wed Nov 04, 2009 10:02 am

No, didn't get to that last night... Dun should be looking at Tute4 rather soon at the very least, so I'm sure I'll hear whether or not it works fine in the near term...
Image
hatboyzero
Journeyman
 
Posts: 115
Joined: Wed Mar 26, 2008 8:32 pm
Location: Oxford, MS

Re: Cross Platform Build system

Postby Dun1031 on Thu Nov 05, 2009 7:31 am

I will be working on compiling this tonight and will update you if I have any issues. :)
Image
Dun1031
 
Posts: 21
Joined: Tue Oct 14, 2008 1:25 pm
Location: Columbus, GA


Return to Architecture, Design, Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron