summaryrefslogtreecommitdiffstats
path: root/Modules/UseSWIG.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'UseSWIG-Java-enabled'Brad King2017-08-031-2/+4
|\ | | | | | | | | | | | | b4fbf677 UseSWIG: Fix when Java is enabled as a language Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1095
| * UseSWIG: Fix when Java is enabled as a languageBrad King2017-08-021-2/+4
| | | | | | | | | | | | | | | | | | | | Since commit v3.8.0-rc1~251^2 (UseSWIG: Record generated java files as custom command outputs, 2016-11-28) the generated `.java` files are listed as sources in the call to `add_library` by swig_add_library. They are listed only as the outputs of custom commands and not intended for compilation as part of the library. Reported-by: Alan W. Irwin <irwin@beluga.phys.uvic.ca>
* | UseSWIG: Add `-dllimport` only if not already specifiedRobert Langlois2017-06-141-4/+7
|/ | | | | | | | SWIG fails with a redefined macro error when `-dllimport` is specified more than once. One case where you would want to specify your own dllimport is when using SWIG with netstandard2.0. .NET Core does not search for shared library like Mono or .NET, so you need a fully qualified shared library name.
* UseSWIG: Fall back to empty PREFIX for unknown languagesBrad King2017-04-251-0/+3
| | | | | | | Teach `SWIG_ADD_LIBRARY` to fall back to an empty library prefix for languages we don't explicitly define already. Suggested-by: Alan W. Irwin <irwin@beluga.phys.uvic.ca>
* Merge topic 'dont-include-CMakeParseArguments'Brad King2017-01-121-3/+0
|\ | | | | | | | | d6877e6c Don't include CMakeParseArguments
| * Don't include CMakeParseArgumentsDaniel Pfeifer2017-01-111-3/+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.
* | UseSWIG: Automatically scan dependencies of SWIG files for MakefilesAlexey Sokolov2017-01-101-0/+1
|/ | | | Issue: #4147
* UseSWIG: Record generated java files as custom command outputscaryoscelus2016-11-291-3/+4
| | | | | | When another target depends on the generated files CMake must know which custom command generates them in order to hook up the dependency properly. We already do this for Python. Add the Java files too.
* UseSWIG: Add USE_BUILD_SHARED_LIBS to accepted values for the TYPE argDaniele E. Domenichelli2016-11-141-1/+3
| | | | | | | | | | The new signature is SWIG_ADD_LIBRARY(<name> [TYPE <SHARED|MODULE|STATIC|USE_BUILD_SHARED_LIBS>] LANGUAGE <language> SOURCES <file>... )
* UseSWIG: Do not set PREFIX property for SHARED and STATIC lua librariesDaniele E. Domenichelli2016-11-111-1/+3
|
* UseSWIG: Do not set NO_SONAME property for SHARED and STATIC librariesDaniele E. Domenichelli2016-11-111-1/+3
|
* UseSWIG: Add swig_add_library macro.Daniele E. Domenichelli2016-11-111-7/+41
| | | | | | | | | | | | | | | | | swig_add_module does not allow to set the type for the library and instead always create the library as MODULE. This patch adds the new swig_add_library command with this signature: SWIG_ADD_LIBRARY(<name> [TYPE <SHARED|MODULE|STATIC>] LANGUAGE <language> SOURCES <file>... ) The swig_add_module is deprecated in favour of swig_add_library. Closes: #16415
* UseSWIG: Add option to specify swig output file directoryCong Zhang2016-11-011-3/+13
| | | | | | | | | | `swig` has two output-related options: * `-o <outfile>`: Set name of C/C++ output file to <outfile> * `-outdir <dir>`: Set language-specific files output directory to <dir> We already have `CMAKE_SWIG_OUTDIR` for the latter. Add a new `SWIG_OUTFILE_DIR` option for the former.
* Simplify CMake per-source license noticesBrad King2016-09-271-14/+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-6/+6
| | | | | | | 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'
* FindSWIG: Do not generate erroneous outputs with -noproxyBen Webb2015-09-091-4/+6
| | | | | | | | | | | | | Generally for a module foo, SWIG generates (in Python mode) an extension module _foo.so and a proxy Python module foo.py. However, if -noproxy is specified, instead it builds only foo.so (without the leading underscore). The custom command generated by CMake correctly handles the removal of this underscore when -noproxy is given; however, it still adds foo.py to the expected outputs. This upsets build tools that expect foo.py to be generated (for example, 'make' will run the SWIG command twice). Fix this by removing foo.py from the set of extra generated files when -noproxy is specified.
* Revert "add_custom_command: Diagnose MAIN_DEPENDENCY limitation."Nils Gladitz2015-04-301-1/+2
| | | | | | | | | | | | This reverts commit 242c3966 (add_custom_command: Diagnose MAIN_DEPENDENCY limitation, 2015-03-09) and the follow up commit b372a99a (UseSWIG: Do not use MAIN_DEPENDENCY on custom commands, 2015-03-26). I misdiagnosed the underlying issue that prompted creation of policy CMP0057. The actual issue surfaces when a single custom command's MAIN_DEPENDENCY is listed in more than one target; this issue will have to be addressed independently.
* UseSWIG: Fix module name detection with relative source file (#15508)Tuukka Pasanen2015-04-151-1/+1
| | | | | | | When SWIG_GET_EXTRA_OUTPUT_FILES checks to see if a source file exists for use in reading the module name, it must pass an absolute path to the if(EXISTS) command. Teach SWIG_ADD_SOURCE_TO_MODULE to give it the absolute path it already knows.
* UseSWIG: Do not use MAIN_DEPENDENCY on custom commands (#15480)Felix Schwitzer2015-03-301-2/+1
| | | | | | | | | Add the dependency on the main swig input source file as a normal DEPENDS option. We cannot use MAIN_DEPENDENCY because if there are multiple target languages then multiple custom commands would want to use the same MAIN_DEPENDENCY, but at most one custom command may specify a given source file as its MAIN_DEPENDENCY. Exposed by a CMP0057 warning.
* UseSWIG: Avoid if() auto-dereferene in quoted argumentsBrad King2015-03-091-4/+4
| | | | | | | Protect against variables named "CSHARP", "PERL", "PYTHON", or "UNKNOWN" when CMP0054 is not set to NEW. Reported-by: Tuukka Pasanen <tuukka@iocaste.ilmi.fi>
* UseSWIG: Fix R module prefixJulien Schueller2014-10-141-0/+2
|
* Merge topic 'UseSWIG-fix-noproxy-check'Brad King2014-06-271-1/+1
|\ | | | | | | | | e932ac9c UseSWIG: Fix check for noproxy flag (#14990)
| * UseSWIG: Fix check for noproxy flag (#14990)Brad King2014-06-251-1/+1
| | | | | | | | | | | | | | | | | | The check for this flag added by commit v3.0.0-rc1~284^2 (UseSWIG: Name python module according to swig flags, 2013-11-26) can get false positives on flags like "-noproxydel". Improve the check to match only "-noproxy". Suggested-by: Garth Wells <gnw20@cam.ac.uk>
* | UseSWIG: Add support for Go and LuaJulien Schueller2014-04-291-0/+4
| |
* | Merge topic 'UseSWIG-guess_module_name'Brad King2014-04-211-17/+56
|\ \ | | | | | | | | | | | | | | | 2c96192f UseSWIG: Revise and format documentation e147c5c5 UseSWIG: Detect module name from interface file (#10080)
| * | UseSWIG: Revise and format documentationJulien Schueller2014-04-211-16/+32
| | | | | | | | | | | | Also add some documentation of SWIG_MODULE_NAME.
| * | UseSWIG: Detect module name from interface file (#10080)Julien Schueller2014-04-211-1/+24
| | | | | | | | | | | | | | | If no SWIG_MODULE_NAME is specified explicitly and the .i file exists, scan it for the module name declaration.
* | | Remove .* expressions from beginning and end of MATCHES regexsRolf Eike Beer2014-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | All these expressions work the same: "foo" ".*foo.*" "^.*foo.*$" This assumes that the "Intel*" expressions were meant to be "Intel.*".
* | | Merge topic 'UseSWIG-NO_SONAME'Brad King2014-04-011-0/+1
|\ \ \ | |/ / |/| | | | | | | | f26147b8 UseSWIG: Enable NO_SONAME on swig modules (#14815)
| * | UseSWIG: Enable NO_SONAME on swig modules (#14815)Julien Schueller2014-04-011-0/+1
| | | | | | | | | | | | Swig modules are plugins and do not need the SONAME field set.
* | | Revert "UseSWIG: Name extra generated files after module name (#10080)"Julien Schueller2014-03-201-4/+3
|/ / | | | | | | This reverts commit f0111deb1ea21f667b2fbf57f55d5ee2a80f5ccc.
* | UseSWIG: Name extra generated files after module name (#10080)Julien Schueller2014-02-241-3/+4
|/
* Help: Fix some erroneous code block markers in Module docs.Stephen Kelly2014-01-071-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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))
* Merge topic 'UseSWIG-octave'Brad King2013-12-021-1/+4
|\ | | | | | | | | f39671c UseSWIG: Handle octave extensions.
| * UseSWIG: Handle octave extensions.Julien Schueller2013-11-291-1/+4
| |
* | Merge topic 'UseSWIG-fix12184'Brad King2013-12-021-2/+12
|\ \ | | | | | | | | | | | | 74f5545 UseSWIG: set .bundle ext on OSX and no prefix (#12184)
| * | UseSWIG: set .bundle ext on OSX and no prefix (#12184)Julien Schueller2013-11-281-2/+12
| |/
* | Merge topic 'UseSWIG-fix13318'Brad King2013-12-021-4/+7
|\ \ | |/ |/| | | | | a87c063 UseSWIG: Name python module according to swig flags (#13318)
| * UseSWIG: Name python module according to swig flags (#13318)Julien Schueller2013-11-261-4/+7
| |
* | Merge topic 'UseSWIG-fix14520'Brad King2013-11-261-0/+1
|\ \ | | | | | | | | | | | | 20028d6 UseSWIG: Remove duplicate include dirs (#14520)
| * | UseSWIG: Remove duplicate include dirs (#14520)Julien Schueller2013-11-251-0/+1
| | | | | | | | | | | | Shorten the swig command line.
* | | Merge topic 'UseSWIG-fix13814'Brad King2013-11-261-0/+4
|\ \ \ | |_|/ |/| | | | | | | | acc59e5 UseSWIG: Handle a dll name different than module name (#13814)
| * | UseSWIG: Handle a dll name different than module name (#13814)Julien Schueller2013-11-251-0/+4
| |/
* | UseSWIG: Fix .i relative source file location (#13173,#13772,#14459)Julien Schueller2013-11-251-30/+2
|/
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-17/+28
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-32/+32
| | | | | | | | | | | | | | | | | 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
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-129/+129
| | | | | | | | | | | | | | | | | Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-5/+5
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* UseSWIG: clean up string comparesRolf Eike Beer2012-02-231-8/+5
|
* Merge topic 'revert-fixbug_0004147'Brad King2011-06-281-59/+0
|\ | | | | | | | | fc04531 Revert "Add a new function SWIG_GET_WRAPPER_DEPENDENCIES to UseSWIG.cmake"