Hello!
There is discussion in the D forums about build systems and someone mentioned 'premake' saying there is D support available (only DMD compiler, iirc).
Still, after reading user manual I must say it looks very nice.
Some time ago I was playing with Haskell and there is nice build tool called Cabal. Later we decided to use Python and were playing a bit with Waf, but, somehow it did not feel right, although we admit it's capable.
Later I became interested in Bento which brings some of the Cabal's simplicity, but it is, of course, strongly tied to Python projects.
Recently, we've decided to do our project in D and here Cmake looks as the best option...
Let me describe our needs...we want to write multi-platform deskop GUI application (at the moment it's not certain yet which toolkit we'll use from the {wx,gtk+,qt} set (it depends on GUI bindings available for D), but we want to have best (possibly native) look on both Linux which will be our main ('native') development platform.
Moreover we want to target Windows OS and CPack's ability to provide binary installers is cool feature.
Ability to support Mac OS X and provide package for this platform is also a 'must'.
How does premake compare here with Cmake/CPack and/or any plan to add such features?
Besides that, we know that we'll use 3rd party C library (shipping its sources with our project) for which we have to build D bindings (using SWIG). Is there any specific support in premake to build SWIG-based extensions?
The rest of the project will consist of many libraries written in D which should use the above mentioned 3rd party as well as GUI part which will make the main exectuable or stand-alone application.
There is also need to provide manual/documentation for the application (e.g. HTML help & possibly PDF), but not knowing about GUI we don't have all the details now.
All in all, it's neither 'hello world' app nor KDE project, so we wonder how does premake compare with Cmake/Cpack in regard to our requirements?
We do not know Lua and wonder how much skills is required to possibly fulfill all the reqs which might be missing in premake at the moment?
In any case, thought of using clear premake's syntax makes us much more enthusiastic than diving into Cmake's macro language...
Sincerely,
Gour

Hi Gour,
> There is discussion in the D forums about build systems and someone mentioned 'premake' saying there is D support available (only DMD compiler, iirc).
Unfortunately, it exists only as an experimental branch [1].
Are you still reading? :) If so, I can help you if you want to play with it and get it integrated into mainline. Premake is very easy to extend because of clean and simple internal structure. Unfortunately I have absolutely no experience with D but I believe it's not a bad choice ;)
>we want to have best (possibly native) look on both Linux
If "both Linux" means "both GTK- and Qt-based environments", I'd certainly recommended Qt, it looks quite natively with GTK engine.
Qt support will be available in upcoming Premake 4.4 as a separate addon (for C++ projects, but could be extended to D if there are any differences).
(BTW, IMHO if you'll use Qt you could painlessly choose C++ over D, as Qt has a lot of batteries included).
>Moreover we want to target Windows OS and CPack's ability to provide binary installers is cool feature.
Ability to support Mac OS X and provide package for this platform is also a 'must'. How does premake compare here with Cmake/CPack and/or any plan to add such features?
Unfortunately, I don't know if anything similar to CPack for Premake exists.
If you're still reading, it seems to be quite easy to implement all its features as an addon for Premake. Actually it's in my TODO list. Do you have any preference for Windows installer builder?
>Besides that, we know that we'll use 3rd party C library (shipping its sources with our project) for which we have to build D bindings (using SWIG). Is there any specific support in premake to build SWIG-based extensions?
AFAIK there's no rocket science in working with SWIG to require a special support from Premake. You'll just need to create new 'action' in your project in which you run a 'for' cycle over file list and run swig command on each to produce source code. Than you'll need to declare a project to compile it.
>We do not know Lua
Don't be afraid, it a very simple and very powerful language!
To sum up, these missing features are actually missing not because it's complex to implement them but because of lack of manpower (or our interest).
[1]. I've found this one: https://bitbucket.org/goughy/premake-dev-d/
Thank for the reference. It was mentioned on D list, but without URL. ;)
Sure. ;)
Consideing there are some '+1' votes in the D-thread, I believe the author himself will revive his work on the D support...
Well, I run Xfce DE and, in general, prefer GTK look, so I did not express myself clearly...On Linux I'm quite satisfied with GTK look, but what I meant with 'both' is Linux AND (Windows & Mac). :-)
What about wxWidgets & GTK+? It works out of the box?
Well, I used C++ in the time of Zortech C++ compiler (long ago) and after giving up on Haskell, I'd still like to use something higher-level (like safeD), so, no, thank you for C++ offering. ;)
OK.
Sure, I'm not giving up so easily. :-)
Cool, cool.
Not really...I'm not doing much with Windows - keeping XP image under vbox in order to use Garmin software - that's all...Otoh, I see that Cpack supports NSIS, but I believe that any GUI installer which can do the job is fine for Windoze users. :-)
Hmm...this sounds as good starting point in more serious encounter with SWIG & premake.
Good. I'm looking at http://lua-users.org/wiki/TutorialDirectory
Well, it looks good...premake is much cleaner, afaict and Lua much more attractive (we could even use it as configuration language for our D application) than Cmake's macro 'language'.
btw, have you considered having mailing list?
99% of things which I follow is available via mailing list which are subscribed to Gmane which makes it much nicer, imho, experience to follow & contribute to.
>What about wxWidgets & GTK+? It works out of the box?
For wxWidgets see here[1]. Maybe not ideal, but should be working. Again, nothing in the context of D.
As for GTK, I don't know (actually I'm Qt developer and unfortunately have no experience in wx or GTK development). AFAIK, currently GTK doesn't use code generation, common practice is using GtkBuilder which loads UIs from XML at runtime, so it should be much simpler than Qt.
>Zortech C++ compiler
Well, it was long ago in a distant galaxy (1991?). C++ has evolved impressively since then, a lot of new platforms (STL, Boost, Qt) are available. Qt is not a "hardcore C++" platform, it doesn't require deep knowledge of C++'s "dark places" and allows you to create GUI applications effectively ("Code less, create more" [2, 3]).
>Not really...I'm not doing much with Windows - keeping XP image under vbox in order to use Garmin software - that's all...Otoh, I see that Cpack supports NSIS, but I believe that any GUI installer which can do the job is fine for Windoze users. :-)
OK, when I start implementing it I'll probably make InnoSetup support at first.
> btw, have you considered having mailing list?
premake-users@lists.sourceforge.net
However, it happened that most discussions take place here, on the forum.
[1] http://wiki.wxwidgets.org/Premake4
[2] http://doc.qt.nokia.com/latest/gettingstartedqt.html
[3] I could also tell you about QML, but I won't because I'm afraid to lose potential Premake user :)
Thank you.
Ohh, interesting...I'm still considering QtD, but development is not very active. We'll see..
Isn't it the same with Qt and wx (using XRC files)?
Right, 1991. ;)
Yes, C+++ evolved into huge beast.
I'd like to esacpe pointer-thingie and believe D is going into right direction.
Yes, I know about QML, but not sure it's ready for the desktop.
Good.
That's nice. I might use it instead.
Do you mind subscribing it to Gmane?
>Isn't it the same with Qt and wx (using XRC files)?
As I wrote before, I haven't developed anything with wx, but it seems to me [1] that these are loaded at run time. In the contrast, Qt resources are "compiled" into C++ files and then embedded into application binary (that's not the single way to use Qt resources, but most popular). If you don't need to generated source code in build time you don't need anything like this.
What I've told you for SWIG may be considered to be "quick and dirty" way to generate code (i.e. it generates files when Premake runs, not make or IDE builder). However it seems to me as acceptable choice for bindings because they don't need to be changed frequently.
[1] http://wiki.wxwidgets.org/Using_XML_Resources_with_XRC
>Do you mind subscribing it to Gmane?
Probably @starkos should decide it.
Well, all of the GUI builders I saw for wxWidgets can generate C++code as well, but considering we'd use D, then we have to think about loading XML-based interface at runtime.
Yeah, Cmake has support to find SWIG stuff...
>Yeah, Cmake has support to find SWIG stuff...
Finding dependencies is a different story. You can find dependencies using functions like os.pathsearch, however in practise when you are developing stuff you often know for sure where things are located, and with CMake you sometimes have to struggle to force it use what you need instead of what it has found automatically.
Hmmm...e.g. on Mac OS X I do not have slight idea where the SWIG might be, so I want that build tool is capable to find it if it's installed.
That's interesting and good to know when comparing premake with Cmake.:-)
>Hmmm...e.g. on Mac OS X I do not have slight idea where the SWIG might be, so I want that build tool is capable to find it if it's installed.
You may safely assume that if it is installed, it is in $PATH. Then just call 'swig', that's all.
If you require specific version of SWIG (e.g., "2.0.0" is required and anything else will fail), it could be more reasonable to provide command line option (see 'newoption') so user could manually specify full path to proper swig executable.
BTW, I've given @gour the go-ahead to subscribe the mailing to Gmane. And I'm following along. I haven't done anything with wxWidgets in quite a long time, but it should still more-or-less work I would think.
Let me just inform you that I've submitted request to Gmane to subscribe premake-users list...now waiting for a reply and/or first new message to appear...
A while ago I did a small test compiling the wxWidgets libraries and a small sample using premake and cmake. I only tested it under Windows though, so Linux/OSX etc is left as an exercise.
See https://github.com/erwincoumans/wxWidgets