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.
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?
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!




