<div>On 2010-10-07, 12:57:50, Bill Hoffman

wrote:<br></div><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><pre>On 10/7/2010 12:37 PM, Ryan Pavlik wrote:
&gt;<i>
</i>&gt;<i>
</i>&gt;<i> On 10/07/2010 09:57 AM, Andreas Schneider wrote:
</i>&gt;&gt;<i> On Thursday 07 October 2010 16:45:49 Andreas Schneider wrote:
</i>&gt;&gt;&gt;<i> My current problem is with javah (C header file generator). This
</i>&gt;&gt;&gt;<i> generator
</i>&gt;&gt;&gt;<i> works on the class files. The class files aren&#39;t in
</i>&gt;&gt;&gt;<i> CMAKE_CURRENT_BINARY_DIR they are located in:
</i>&gt;&gt;&gt;<i>
</i>&gt;&gt;&gt;<i> ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/&lt;project&gt;.dir/&lt;some&gt;/&lt;directory&gt;/foo
</i>&gt;&gt;&gt;<i>
</i>&gt;&gt;&gt;<i> bar.class
</i>&gt;&gt;&gt;<i>
</i>&gt;&gt;&gt;<i> So my current problem is how to point the generator there ...
</i>&gt;&gt;<i> In the language information file, this is&lt;OBJECT_DIR&gt; so is there
</i>&gt;&gt;<i> something
</i>&gt;&gt;<i> like CMAKE_CURRENT_OBJECT_DIR?
</i>&gt;&gt;<i>
</i>&gt;&gt;<i>
</i>&gt;&gt;<i> -- andreas
</i>&gt;<i>
</i>&gt;<i> I made a CMake-based build for the VRPN Java bindings, which require a
</i>&gt;<i> javah call. I have no experience actually using them, so I&#39;m not sure if
</i>&gt;<i> they work, but they certainly compile. (Of course, I didn&#39;t realize
</i>&gt;<i> there was CMake Java support, so this is all add_custom_command/target
</i>&gt;<i> driven) Perhaps it will help:
</i>&gt;<i>
</i>&gt;<i> <a href="http://github.com/rpavlik/vrpn/blob/cmake-java/java_vrpn/CMakeLists.txt">http://github.com/rpavlik/vrpn/blob/cmake-java/java_vrpn/CMakeLists.txt</a>
</i>&gt;<i>
</i>&gt;<i> Hope this helps!
</i>&gt;<i>
</i>&gt;<i> Ryan
</i>&gt;<i>
</i>The java support was broken a while ago when we re-organized the build 
trees.   I don&#39;t have much time to work on this, but I would like to get 
it fixed.  The best approach might be a pure custom command approach. 
We could model it after the scons java support which is quite simple.  I 
am thinking of adding a module for java building into the Modules 
directory as java does not really fit our language type that well.

Anyone want to help?

-Bill 
</pre></blockquote><div><br>I would be interested in improving Java support in CMake.  A source code parser which finds out names of generated output object files, as in the SCons Java support, is a must.  That&#39;s what the current Java support in CMake lacks the most.  I&#39;ve searched through CMake source code and it looks like the object file name is always obtained just from the source file name.  Unfortunately this doesn&#39;t work for Java.  Would you please give me some more details on how do you see the module implemented?  Or some hints from where to start?  The most tricky part is how to handle changing dependencies.  Should the classes and jar be separate targets, as it is in SCons?<br>
<br>--<br>Best regards,<br>Micha³ Czuczman</div>