[CMake] Complaint about if..endif

Michael Jackson mike.jackson at bluequartz.net
Sun Nov 23 12:18:31 EST 2008


On Nov 23, 2008, at 11:43 AM, cyril_wobow wrote:

> Robert Dailey a écrit :
>> On Sun, Nov 23, 2008 at 4:20 AM, cyril_wobow <cyril at wobow.com <mailto:cyril at wobow.com 
>> >> wrote:
>>
>>    Like a ... python front end ?
>>
>>    Seriously, cmake is really, really, really verbose and terribly
>>    unreadable as a scripting language...
>>
>>
>> I would agree with you in that CMake isn't perfect and it does have  
>> a lot of issues that I've seen in the few hours I've spent learning  
>> it. It has some issues with portability and it also is pretty  
>> unreadable/verbose in some cases. However, considering alternatives  
>> I would say it could be worse. Boost.Build (BJam) is absolutely one  
>> of the most unreadable languages I've seen. I refuse to use it just  
>> because of that fact. I also have yet to find another build system  
>> that generates visual studio project files like CMake does. It  
>> would be nice to see alternatives for comparison though.
> Sure, I guess we are all here because CMake is a very powerful  
> suite, with tons of functionalities and useful abstractions. But I  
> challenge anyone to seriously tell me that he/she enjoys writing  
> CMake script. As soon as you don't have to only set a bunch of  
> variables and call a few built-in macros any more, you get crazy. Do  
> a bit of string processing, you get crazy. Write/call your own  
> functions and macros, with argument passing and returning, you get  
> crazy.
> To me, that is definitely THE weakest point of CMake, along with its  
> fairly arnarchic documentation.
> I would be very interested by others' testimonies.
> Kudos anyway to the CMake team!

While there are certainly some areas where CMake could be improved  
upon the general cross platform support is better than any  
alternatives. And the alternatives are not very pleasing...

If I have a project that I need to compile on Windows (MinGW and  
MSVC), OS X, and Linux my choices are:
   CMake
    OR
Makefiles for Linux/MinGW
Xcode Project for OS X (or reuse the Makefiles)
MSVC Projects for Windows.

Now say that I don't know makefiles and only a passing familiarity  
with Visual Studio. What am I to do? I can use CMake and be reasonably  
confident for my project that I can get a working Visual studio,  
makefiles and Xcode project generated for each.

   Or better yet, what if I was at a small company where the linux/os  
x guy left and I was a windows guy who didn't know _anything_ about OS  
X or linux. Who would keep those projects updated? What if it was  
OpenSource? Now you have to find another willing contributor to keep  
everything up to date for the missing build systems..

   The documentation is another issue all together. I think it could  
be massively improved but unfortunately I do not have the time to lend  
a hand. I have given what I can (Qt Assistant based docs) that allow  
one to more easily look for commands, properties and variables but  
that is about it.

   Having started to update the current implementation of boost's  
cmake build system it is becoming apparent that CMake is lacking in  
some areas where bjam has the same functionality. This stems from the  
fact that a lot of time is spent on making sure bjam works to build  
boost so of course bjam has functionality used by boost.build. If that  
same time was spent getting the CMake system working for boost then I  
don't think there would be as many issues.

Obviously CMake scales, just look at the KDE project. They selected  
CMake and it _seems_ to be working for them. Andreas can probably add  
some more here.

In summary for my projects (Qt, Command line based, HDF5/XML projects)  
and for the number of employees I have (me) CMake is a very large time  
saver over the alternatives.

Just my 2 cents

_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio





More information about the CMake mailing list