summaryrefslogtreecommitdiffstats
path: root/Modules/UseJava.cmake
Commit message (Collapse)AuthorAgeFilesLines
* UseJava: Quote -classpath argument correctly on more platformsBrad King2020-04-101-3/+9
| | | | | | | | | | Add the `VERBATIM` option to our `add_custom_command` calls so that all arguments are correctly escaped for the shell. Otherwise when using a POSIX shell on Windows, the `-classpath` separator is `;` and without quoting ends the command. Fixes: #20567 Inspired-by: Nevyn Bengtsson <nevyn.jpg@gmail.com>
* UseJava: clean class files from previous buildsAlexey Karndshev2020-04-061-2/+9
| | | | | | | | If java_class_filelist exists, remove previous class files before building the new ones. If java_sources content has changed, clean and rebuild the class files of the target. Fixes: #20377
* Merge topic 'function-var-current'Kyle Edwards2019-12-121-2/+1
|\ | | | | | | | | | | | | | | | | | | 24fdd51f45 Refactor: Replace CMAKE_CURRENT_LIST_DIR with CMAKE_CURRENT_FUNCTION_LIST_DIR 90e3e2a777 cmFunctionCommand: Introduce `CMAKE_CURRENT_FUNCTION*` variables dd54290dab Refactor: Modernize `function` command Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !4000
| * Refactor: Replace CMAKE_CURRENT_LIST_DIR with CMAKE_CURRENT_FUNCTION_LIST_DIRAlex Turbov2019-12-101-2/+1
| | | | | | | | | | | | Some modules define an intermediate global scope visible variables to access "resource" files from functions. Now these variables could be eliminated.
* | UseJava: Use correct path separator in javadocNathan Burles2019-11-201-20/+4
| | | | | | | | For both classpath and sourcepath.
* | UseJava: Use list(APPEND) to simplify javadoc option constructionNathan Burles2019-11-201-10/+11
| |
* | UseJava: Extract the path separator to module levelNathan Burles2019-11-201-15/+10
|/ | | | | It is currently only defined within the add_jar function, but is needed inside other functions in this module.
* UseJava: Use ADDITIONAL_CLEAN_FILES for cleaningSebastian Holtermann2019-05-151-1/+2
| | | | | Replace use of the deprecated `ADDITIONAL_MAKE_CLEAN_FILES` directory property with the new `ADDITIONAL_CLEAN_FILES` directory property.
* UseJava: Refactor documentation for better formattingRobert Maynard2019-05-151-294/+229
| | | Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* UseJava: clean-up if() expressionsMarc Chevrier2019-01-281-147/+147
| | | | Fixes: #18836
* UseJava: add_jar: rebuild jar on dependencies changesMarc Chevrier2018-12-111-1/+1
| | | | Fixes: #18683
* Help: Convert remaining modules to block-style commentsKitware Robot2018-10-221-432/+433
|
* Merge branch 'backport-java-new-packaging' into java-new-packagingBrad King2018-04-251-5/+5
|\ | | | | | | Fix conflicts by combining the changes from both sides.
| * FindJava, FindJNI, UseJava: update for version 10 supportMarc Chevrier2018-04-251-5/+5
| | | | | | | | | | | | | | * new version format * new registry layout on Windows Fixes: #17938
* | MAINT: Misc. typosluz.paz2018-02-131-1/+1
|/ | | | Found via `codespell -q 3 -I ../cmake-whitelist.txt`.
* add_jar: add option GENERATE_NATIVE_HEADERSMarc Chevrier2018-01-221-1/+73
|
* Fix trivial typos in textluzpaz2017-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some are user facing. Found using codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt` whereby the whitelist contained: ans dum helpfull emmited emmitted buil iff isnt nto ot pathes substract te todays upto whitespaces
* UseJava: add_jar OUTPUT_DIR option used only for jar generation.Marc Chevrier2017-10-121-4/+4
| | | | | | Build artifacts go to CMAKE_CURRENT_BINARY_DIR subdirectory in all cases. Fixes: #17341
* UseJava: OUTPUT_DIR must exists in all cases.Marc Chevrier2017-10-101-0/+2
| | | | Fixes: #17316
* Use string(APPEND) in ModulesDaniel Pfeifer2017-05-171-1/+1
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_\$\{\}]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* UseJava: Support namespaced exportsMatthew Woehlke2017-04-211-15/+21
| | | | | | | | | Add NAMESPACE option to export_jars and install_jar_exports. Import JAR's as imported static libraries rather than custom targets, as this is necessary to allow the imported targets to contain ':' in their names. (This also means they won't show up in VS projects, which is more consistent with other imported targets.) Also, improve the documentation to be more stylistically consistent with documentation elsewhere.
* Don't include CMakeParseArgumentsDaniel Pfeifer2017-01-111-2/+0
| | | | | | | | | | | | The cmake_parse_arguments command is builtin with version 3.5. The CMakeParseArguments module is empty and exists for backwards compatibility with CMake 3.4 and lower. Remove the includes of CMakeParseArguments from CMake's modules. The modules are always used with the current version of CMake. Leave the includes in the tests, as the tests may be run with an older version of CMake.
* Simplify CMake per-source license noticesBrad King2016-09-271-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Use string(APPEND) in ModulesDaniel Pfeifer2016-07-271-3/+3
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* UseJava: Fix race condition creating java class listMatthew Woehlke2016-06-091-5/+5
| | | | | | | | | | | | | | | | | Modify logic to unconditionally create an empty class list response file to instead only create the empty file if no classes are being compiled. Otherwise, the response file is created via a custom command that generates the correct list. This fixes a race condition on certain systems (e.g. HFS on OS X) where the dependency for creating the "correct" list can have the "same" (due to limited precision of the filesystem) timestamp as the empty file created at configure time, resulting in an empty class list being incorrectly used to invoke `jar` (resulting in `jar` being unhappy that it was not given any input files). Although one would have some hope that this doesn't affect "real" projects, it definitely does affect the JavaExportImport unit test, causing the same to fail randomly when run on an HFS partition.
* UseJava: Add infrastructure to export targetsMatthew Woehlke2016-06-071-0/+153
| | | | | | Add additional functions to UseJava.cmake to create "exported" targets, similar to those of C/C++ libraries. In support of this, ensure that the JAR_FILE property of jar targets is always an absolute path.
* UseJava: Fix grammar error in documentationMatthew Woehlke2016-05-311-1/+1
|
* UseJava: use CMAKE_COMMAND instead of direct cmake callBrad King2016-04-061-1/+1
| | | | Author: dancing-leaves <dancing-leaves@users.noreply.github.com>
* Fix spelling typos in comments and documentation (#16037)Felix Geyer2016-03-291-1/+1
| | | | | The Debian package checker tool (lintian) detected several typos in CMake.
* UseJava: Fix documented name of `CLASSDIR` property (#15936)Brad King2016-01-261-1/+1
| | | | It is not `CLASS_DIR`.
* UseJava: Fix create_javah CLASSPATH handling on WindowsMarc Chevrier2016-01-191-2/+2
| | | | Preserve semicolons in the value.
* UseJava: Allow relative path to manifest file just as with other sourcesMarc Chevrier2015-12-031-1/+1
|
* UseJava: Add support for javah toolMarc Chevrier2015-08-211-0/+157
| | | | Add a `create_javah` API.
* UseJava: Teach install_jar new DESTINATION and COMPONENT optionsMarc Chevrier2015-08-041-6/+48
|
* UseJava: Teach add_jar to support file syntax for sourcesMarc Chevrier2015-08-041-9/+25
|
* UseJava: Fix add_jar argument parsing (#14655)Mark Studenka2015-03-201-11/+11
| | | | | | | Since commit v2.8.11~63^2 (UseJava.cmake: require explicit request to include jars, 2013-03-26) the argument parsing always overrides the variable settings even if the corresponding arguments are not passed. Re-order logic to fix this.
* UseJava: Fix classpath separator on WIN32 cross compilation (#15206)Lorenz Witte2014-10-141-1/+1
| | | | | | | The condition to use ";" as classpath separator includes a check for the switch "WIN32" which is a target switch. When cross-compiling for a non-windows target, this switch is not present and the separator defaults to ":". It should check for "CMAKE_HOST_WIN32" instead.
* UseJava: Copy resource files before compiling the jar (#13360)Bruno Nova2014-03-201-3/+5
| | | | Co-Author: Mary Ellen Foster <mefoster@gmail.com>
* Help: Fix some erroneous code block markers in Module docs.Stephen Kelly2014-01-071-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are many style errors in these files. This patch fixes only the syntactical errors. The script which ported these to rst tripped on some incorrectly formatted blocks in the original input documentation. Use a new script to find problematic code (and then fix them manually): #!/usr/bin/env python import os rootDir = '.' def checkFile(fname): f = open(fname) lines = f.readlines() started = False counter = 0 for l in lines: if "#" in l: started = True elif started: return lin = l.find("(") if lin != -1 and l.find(")", lin) == -1 and \ not "(To distribute this file outside of CMake, substitute the full" in l: for lp in lines[counter+1:]: if lp == "# ::\n": print "\n\n######### " + fname + "\n\n" print ''.join(lines[max(counter-2, 0):counter+6]) break elif lp == "#\n" : continue break counter += 1 for dirName, subdirList, fileList in os.walk(rootDir): for fname in fileList: checkFile(os.path.join(dirName, fname))
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-141/+261
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* UseJava: Add support for the jar 'm' (Manifest) optionSimon Levermann2013-09-231-3/+13
|
* UseJava: Update notice of copyright by KitwareBrad King2013-07-171-1/+1
|
* UseJava: Pass sources to javac using response file (#13028)Graham Markall2013-07-161-1/+7
| | | | | | | | 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.
* UseJava.cmake: document add_jar compat shimMatthew Woehlke2013-06-171-0/+7
| | | | | | | | 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.
* Merge topic 'use-java-use-parse-arguments'Brad King2013-05-281-35/+58
|\ | | | | | | | | 81b5fb5 UseJava.cmake: fully use cmake_parse_arguments in add_jar
| * UseJava.cmake: fully use cmake_parse_arguments in add_jarMatthew Woehlke2013-03-281-35/+58
| | | | | | | | | | | | | | 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.
* | Allow using Java in a cross-compilation toolchainGregoire Lejeune2013-05-081-1/+1
|/ | | | | | 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.
* UseJava.cmake: require explicit request to include jarsMatthew Woehlke2013-03-281-18/+40
| | | | | | | | | | 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.)
* UseJava.cmake: accept jar targets in add_jarMatthew Woehlke2013-03-131-1/+8
| | | | Modify add_jar to also accepts jars by target name.
* UseJava.cmake: fix passing jars to add_jarMatthew Woehlke2013-03-131-1/+5
| | | | | | | | | 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.