[CMake] CMake Java Support

Eric Noulard eric.noulard at gmail.com
Tue Jan 11 20:43:52 EST 2011


2011/1/11 Andreas Schneider <asn at redhat.com>:
> On Tuesday 11 January 2011 16:01:14 Andrea Galeazzi wrote:
>> Hi Andreas,
>
> Hi Andrea,
>
>> I'm a dyed-in-the-wool Java developer (and also Fedora user) so it makes
>> me very happy to know that someone are working to integrate Java in
>> CMake. My question is: shouldn't Ant be enough? Or better, Could
>> invoking an Ant file as pre/post build command in CMakeLists always
>> accomplish any kind of build requirement?
>
> a) As I've said before this is a C, C++ and Java project. I don't think that
> ant supports C or C++

Sure
http://ant-contrib.sourceforge.net/cpptasks/index.html
but I think I won't use it for C/C++ I'll use CMake :-]

> b) I don't like XML and this is why I would never use ant.

Ack :-] Don't like it either but...

> c) I don't see a reason to use ant when CMake ist able to do the same the way
> I like and prefer.

May be because Ant was designed to build java in the first place
and because CMake was meant to build C/C++ and not Java?
Because some Java IDE may create ant build file?

I won't argue further on that and I currently seldom program with Java
but when I do
I use ant because I was used to it.

**personally** if I was about to use CMake for Java I would expect to
be able to do

PROJECT(MyProj Java)

ADD_LIBRARY(Blah src1.java src2.java)
INSTALL(TARGET Blah ....)

which would make Java like any other language supported by CMake.
May be an "Ant generator" may be created in order to easily open the
corresponding
Java project in Eclipse/NetBean?

That said from reading the set of CMake macros you wrote
I think they are very well designed and organized so on
multi-language project primarily using C/C++ they may well be very useful.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list