summaryrefslogtreecommitdiffstats
path: root/Modules/UseSWIG.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-01 20:22:53 (GMT)
committerBrad King <brad.king@kitware.com>2017-08-02 15:52:36 (GMT)
commitb4fbf677bbbb0a2789955f3d27ff24dd3ffac714 (patch)
treefa2e3dd942c611e7ef3297524ba8ac7398bb2f6a /Modules/UseSWIG.cmake
parentf15cfd891d1e01247ed285320ae32b6c3182ac8f (diff)
downloadCMake-b4fbf677bbbb0a2789955f3d27ff24dd3ffac714.zip
CMake-b4fbf677bbbb0a2789955f3d27ff24dd3ffac714.tar.gz
CMake-b4fbf677bbbb0a2789955f3d27ff24dd3ffac714.tar.bz2
UseSWIG: Fix when Java is enabled as a language
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>
Diffstat (limited to 'Modules/UseSWIG.cmake')
-rw-r--r--Modules/UseSWIG.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index bfe1a6f..fc815dd 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -125,8 +125,10 @@ macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
endif()
foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSIONS})
- set(${outfiles} ${${outfiles}}
- "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}${it}")
+ set(extra_file "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}${it}")
+ list(APPEND ${outfiles} ${extra_file})
+ # Treat extra outputs as plain files regardless of language.
+ set_property(SOURCE "${extra_file}" PROPERTY LANGUAGE "")
endforeach()
endmacro()