Premake Is The Stuff Dreams Are Made Of
Posted in Articles on April 30th, 2011 by PyrokaFor a while now, I have had a task to create a CMake (or the like) script to generate the files needed to compile LibCT for various different compilers. (This was a task originally scheduled for version 2, and got pushed back to version 2.1 as a ‘nice-to-have’ feature).
The reason for my reluctance with regards to completing this task has been just how complex CMake is, even after a brilliant tutorial by my good friend Jamie. Now, don’t get me wrong, I’m not one to shy away from complex tasks, it’s good to have a nice mini-project to sink a couple of weekends into, and learning CMake probably would have been valuable in the future. It was the un-needed complexity that bothered me, the longer I looked at it the more the feeling grew that There has to be a better way to do this, and as much as I love a challenge, I love efficiency more and the thought of so much (apparently un-needed) work did not appeal.
Also on my ToDo list for a while has been to check out a little project called Premake, after reading about it at that fountain of useful information, #AltDevBlogADay so today I finally got around to checking it out, and everything I learned about it just made it better and better.
After a few hours of reading around the documentation, there was no bad news, it supported everything I wanted to do, and in about half the number of lines it would take to get CMake to do things. It was also really rather fast, generating projects much more speedily that CMake had ever done.
I’ll let their (ample) documentation and sample-code explain the system better, but the up-shot of all this is that after a few hours of faffing around I’ve got a Premake script capable of generating (currently VS2010) projects that can successfully build both the LibCT library and EdCT executable.
Task Complete.