[CMake] add_jar()

Pastrana, Rodrigo (RIS-BCT) Rodrigo.Pastrana at lexisnexis.com
Wed Jan 30 10:51:39 EST 2013


Bumping my newbie question... I need to add a jar to the output of add_jar(). Anybody know how to do this?

Thanks, Rodrigo.
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Pastrana, Rodrigo (RIS-BCT)
Sent: Tuesday, January 29, 2013 12:25 PM
To: 'cmake at cmake.org'
Subject: [CMake] Adding dependency jar to jar

Hello, I've been creating a jar based on my java project without issue, but now I'm adding an external dependency and will like to package the said dependency's contents within my output jar.

I'm able to build the project via CMAKE by adding the external.jar to the CMAKE_JAVA_INCLUDE_PATH list:

LIST(APPEND CMAKE_JAVA_INCLUDE_PATH ${EXTERNAL_BUILDTIME_JAR})
ADD_JAR(${JAR_FILE} ${JAVA_SOURCE_FILES})

And I've tried a few things to include ${EXTERNAL_RUNTIME_JAR} in ${JAR_FILE} to no avail.
Does anybody know a way to accomplish this? (btw using CMAKE 2.8).

Using ANT through eclipse I was able to include the external using zipgroupfileset:
<jar jarfile="myjavaproj.jar" includes="**/*.class" basedir="bin">
                <zipgroupfileset dir="/XXX/yyy/zzz/" includes="external.jar"/>
</jar>

Thanks in advance. RP.




-----------------------------------------
The information contained in this e-mail message is intended only
for the personal and confidential use of the recipient(s) named
above. This message may be an attorney-client communication and/or
work product and as such is privileged and confidential. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are
hereby notified that you have received this document in error and
that any review, dissemination, distribution, or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and
delete the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130130/92129146/attachment-0001.htm>


More information about the CMake mailing list