|
Notes |
|
|
(0021510)
|
|
Denis Scherbakov
|
|
2010-07-28 10:00
|
|
I am using 2.6.4 and the problem is still there. (not sure about 2.8) What we need is just to be able to specify an entry point.
- CMAKE_Java_CREATE_STATIC_LIBRARY: <CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}
+ CMAKE_Java_CREATE_STATIC_LIBRARY: <CMAKE_Java_ARCHIVE> -cfe <TARGET> org.my.special.java.class.MyEntryPoint -C <OBJECT_DIR> ${class_files_mask}
Example:
/usr/bin/jar -cfe myprog.jar org.my.special.java.class.MyEntryPoint -C CMakeFiles/myprog.dir . |
|
|
|
(0021512)
|
|
Denis Scherbakov
|
|
2010-07-28 11:04
|
|
Or alternatively, we could use ADD_LIBRARY and then ADD_CUSTOM_COMMAND to update JAR:
MACRO(MACRO_MAKE_JAR_EXECUTABLE VAR_TARGET VAR_ENTRY)
GET_TARGET_PROPERTY(VAR_LOCATION "${VAR_TARGET}" LOCATION)
ADD_CUSTOM_COMMAND(TARGET ${VAR_TARGET} POST_BUILD COMMAND ${CMAKE_Java_ARCHIVE} ufe ${VAR_LOCATION} ${VAR_ENTRY} COMMENT "Creating JAR entry point.")
UNSET(VAR_LOCATION)
ENDMACRO()
SET (MY_ENTRY "path.to.my.Main")
ADD_LIBRARY(MyJavaLibrary ${MY_SRCS})
MACRO_MAKE_JAR_EXECUTABLE(MyJavaLibrary "${MY_ENTRY}") |
|
|
|
(0041424)
|
|
Kitware Robot
|
|
2016-06-10 14:27
|
|
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
|