[CMake] CMake Java Support

Allen D Byrne byrn at hdfgroup.org
Thu Feb 10 14:18:56 EST 2011


Andreas,
   The proposed command at the end of add_jar will give me a classpath variable with all the required jars and with the target jar:
set(${_TARGET_NAME}_CLASSPATH ".${CMAKE_JAVA_INCLUDE_PATH_FINAL}/${_TARGET_NAME}.jar" PARENT_SCOPE)

NOTE the use of CMAKE_JAVA_INCLUDE_PATH_FINAL and not CMAKE_JAVA_CLASS_OUTPUT_PATH.

For the resurce files, since the add_jar already copies the files I just added a prefix parameter for resource files. A bit brute force but effective.

Allen

> On Saturday 05 February 2011 16:04:15 Allen D Byrne wrote:
> > Yes! That is where I meant! (dang email doesn't read minds properly:)
> 
> there is already ${_TARGET_NAME}_JAR_FILE which is exactly what you want.
>  
> > BTW, I have a problem I couldn't fix. When doing an add_jar with source in
> > the current dir and resource files (image files) in a sub-directory, the
> > resource files in the jar are at the class base instead of below. Example;
> > 
> > Want:
> > x.jar
> > ---- classpath1
> > ---------classpath2
> > ------------classA
> > ------------images
> > ----------------Z.img
> > 
> > Get:
> > x.jar
> > ---- classpath1
> > ---------classpath2
> > ------------classA
> > ----images
> > -------Z.img
> 
> I think then you have to move the images to the right location. Resource files 
> are just copied to the same location as in the source dir. They are not 
> magically moved.
> 
> 
> 	-- andreas
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110210/001f7dc5/attachment-0001.htm>


More information about the CMake mailing list