[cmake-developers] [CMake 0012886]: Add a manifest or main-class file to the created jar

Mantis Bug Tracker mantis at public.kitware.com
Thu Jan 19 06:00:33 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12886 
====================================================================== 
Reported By:                Frank Glinka
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12886
Category:                   CMake
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-01-19 06:00 EST
Last Modified:              2012-01-19 06:00 EST
====================================================================== 
Summary:                    Add a manifest or main-class file to the created jar
Description: 
Hello,

the attached patch introduces two optional options to the add_jar function:

1) CMAKE_JAVA_MANIFEST

   To include name : value attribute pairs from a manifest file in the
   created jar at META-INF/MANIFEST.MF you can set the manifest file with:

        set(CMAKE_JAVA_MANIFEST mymanifest.mf)
        add_jar(foobar foobar.java)

2) CMAKE_JAVA_EXECUTABLE

   To set a class as the application entry point for stand-alone applications
   bundled into an executable jar you can set its name with:

        set(CMAKE_JAVA_EXECUTABLE foo/Main)
        add_jar(foobar foo/Main.java)

The latter one was wasn't my priority but I included it as it was easy to 
realize along the first patch. It is easier to use for people only wishing to
create an executable jar than achieving the same by creating a manifest file.

Regards,
Frank

 
P.S. The corresponding discussion for this patch on the mailing list can be 
found here: http://www.cmake.org/pipermail/cmake/2011-December/048015.html
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-01-19 06:00 Frank Glinka   New Issue                                    
2012-01-19 06:00 Frank Glinka   File Added:
java-manifest-executable-option.patch                    
======================================================================




More information about the cmake-developers mailing list