Commit Graph

25 Commits

Author SHA1 Message Date
Simon Levermann 69aff17d38 UseJava: Add support for the jar 'm' (Manifest) option 2013-09-23 14:54:33 +02:00
Brad King 53431ea259 UseJava: Update notice of copyright by Kitware 2013-07-17 08:33:34 -04:00
Graham Markall 177c0516ce UseJava: Pass sources to javac using response file (#13028)
The command line string passed to javac can exceed the 8191-character
limit on Windows when there are a large number of files to compile.
To avoid this, the list of sources is written to a file which is then
passed to javac as an argfile.  Spaces in paths are dealt with by
enclosing each file in quotes, and separating files with a newline.
2013-07-16 13:29:00 -04:00
Matthew Woehlke b41771dfeb UseJava.cmake: document add_jar compat shim
Document the logic that parses for backward compatibility the old
variables that were used to control add_jar prior to named argument
support. In particular, document that the reason this logic exists is
for backward compatibility, and that new features do not need to add to
it.
2013-06-17 12:26:24 -04:00
Brad King 9c1393217c Merge topic 'use-java-use-parse-arguments'
81b5fb5 UseJava.cmake: fully use cmake_parse_arguments in add_jar
2013-05-28 10:42:12 -04:00
Gregoire Lejeune 778aacc864 Allow using Java in a cross-compilation toolchain
Since Java is a portable language, if you want to use Java when
cross-compiling, UseJava uses the JVM installed on the host.  So in this
case, we must use set CMAKE_JAVA_INCLUDE_FLAG_SEP for the current host.
2013-05-08 11:45:34 -04:00
Matthew Woehlke 81b5fb5b0d UseJava.cmake: fully use cmake_parse_arguments in add_jar
Modify add_jar to fully use named arguments, rather than cmake
variables, for specifying output names/directories, etc. For backward
compatibility, the old variables are still honored if set, although
named arguments will override them.
2013-03-28 10:36:33 -04:00
Matthew Woehlke 8a2fca8cd7 UseJava.cmake: require explicit request to include jars
Modify add_jar to (partly) use cmake_parse_arguments, and to require
using the named argument list INCLUDE_JARS to specify jar files (or jar
targets) to use as dependencies when creating a jar. This preserves the
ability to have such, while restoring the historic behavior that jar
files listed as sources are ignored. (The code now explicitly ignores
them, however, rather than adding them to an unused local variable, so
that it is more clear that nothing is being done with them.)
2013-03-28 10:35:42 -04:00
Matthew Woehlke adeafad488 UseJava.cmake: accept jar targets in add_jar
Modify add_jar to also accepts jars by target name.
2013-03-13 17:34:50 -04:00
Matthew Woehlke 53a05b8f51 UseJava.cmake: fix passing jars to add_jar
Fix setting classpath when encountering a jar argument to add_jar to
actually set the variable that is used to specify the classpath to
javac, instead of just uselessly appending the jar to
CMAKE_JAVA_INCLUDE_PATH (which is never used again at the point where it
is modified). Also, list jars so specified as dependencies of compiling
the java sources for the jar target.
2013-03-13 17:30:16 -04:00
Matthew Woehlke 45c8e4b181 UseJava.cmake: simplify path logic
Move logic to determine relative path to .java file to after the file
extension check, so that it only executes when it is actually used.
2013-03-13 17:29:14 -04:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Rolf Eike Beer 5593d5718e UseJava: fix find_jar() called with multiple files (#13281) 2012-06-08 17:35:32 +02:00
Rolf Eike Beer 8bdd44958b UseJava: fix typo in variable name (#13135)
As Dave Abrahams pointed out CMAKE_CURRENT_SOURCE_PATH is wrong, it's of
course CMAKE_CURRENT_SOURCE_DIR.

Also wrap the path in quotes so the example would even work if the source path
has spaces.
2012-04-16 22:41:49 +02:00
Modestas Vainius d36d29f1f0 various typo and formatting fixes in manual pages (#12975)
The patch fixes the following lintian warnings:

W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakemodules.1.gz 2728: warning: macro `..' not defined
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz overriden overridden
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz overriden overridden
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz explicitely explicitly
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz jave java
W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakeprops.1.gz 1040: warning [p 25, 3.7i]: can't break line
W: cmake: manpage-has-errors-from-man usr/share/man/man1/cmake.1.gz 4233: warning [p 85, 1.3i]: can't break line
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz overriden overridden
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz overriden overridden
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz explicitely explicitly
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz jave java
2012-02-18 16:12:45 +01:00
Nicolas Despres 18e8d2f0cc java: Add CMAKE_JAVA_JAR_ENTRY_POINT optional variable.
Thanks to Matthieu Carpentier.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2012-02-13 13:28:28 +01:00
Nicolas Despres 525bb92a3d java: Add CMAKE_JAVA_TARGET_OUTPUT_DIR optional variable.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2012-02-13 13:28:13 +01:00
Nicolas Despres 17a8e16cd2 java: Factor jar output path.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2012-02-13 13:27:48 +01:00
Andreas Schneider e01b98ee4d Modules: Add support for more java archives in add_jar(). 2011-08-29 08:51:45 +02:00
Andreas Schneider 1417a55754 Java: Fix documentation format and indentation 2011-06-20 10:01:50 -04:00
Andreas Schneider 0b7627df0a Java: Use set_property/get_property for target variables. 2011-06-20 10:00:11 -04:00
Oliver Buchtala b01a50567a Java: Create correct jar archive dependencies.
The command generating the jar file depends on java_class_filelist which
is generated by another command.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2011-04-04 11:50:04 +02:00
Oliver Buchtala f99c3120c9 Java: Added some dependency magic to avoid recompilations.
Compile java sources within a custom_command using automatically checked
file dependencies and create java_class_filelist after java compile.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2011-04-04 11:50:04 +02:00
Oliver Buchtala f3233ba521 Java: Create java_class_filelist only if it does't exist.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2011-04-04 11:49:58 +02:00
Andreas Schneider 5c2106c71e Modules: Added CMake Java support.
This provides:
    find_jar
    add_jar
    install_jar
    install_jni_symlink
    create_javadoc
2011-03-29 11:54:42 +02:00