summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-06-13 14:51:49 (GMT)
committerBrad King <brad.king@kitware.com>2018-06-13 14:51:49 (GMT)
commit93fe9fc1a218ac96756cf8181a2d3421ab090192 (patch)
tree309c7f6750eb37101769724abecec9824a5843b0 /Modules
parentf024f4f8a0f37d9c4904f2a968b3ed309146650d (diff)
parent0c2fb4c8964b6164c44e8641c8c9225369c0228b (diff)
downloadCMake-93fe9fc1a218ac96756cf8181a2d3421ab090192.zip
CMake-93fe9fc1a218ac96756cf8181a2d3421ab090192.tar.gz
CMake-93fe9fc1a218ac96756cf8181a2d3421ab090192.tar.bz2
Merge branch 'UseSWIG-csharp-variant' into release-3.12
Merge-request: !2137
Diffstat (limited to 'Modules')
-rw-r--r--Modules/UseSWIG.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 54b90c3..7127b8f 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -189,6 +189,7 @@ set(SWIG_EXTRA_LIBRARIES "")
set(SWIG_PYTHON_EXTRA_FILE_EXTENSIONS ".py")
set(SWIG_JAVA_EXTRA_FILE_EXTENSIONS ".java" "JNI.java")
+set(SWIG_CSHARP_EXTRA_FILE_EXTENSIONS ".cs" "PINVOKE.cs")
##
## PRIVATE functions
@@ -263,10 +264,14 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
endif()
foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSIONS})
set(extra_file "${generatedpath}/${module_basename}${it}")
+ if (extra_file MATCHES "\\.cs$")
+ set_source_files_properties(${extra_file} PROPERTIES LANGUAGE "CSharp")
+ else()
+ # Treat extra outputs as plain files regardless of language.
+ set_source_files_properties(${extra_file} PROPERTIES LANGUAGE "")
+ endif()
list(APPEND files "${extra_file}")
endforeach()
- # Treat extra outputs as plain files regardless of language.
- set_source_files_properties(${files} PROPERTIES LANGUAGE "")
set (${outfiles} ${files} PARENT_SCOPE)
endfunction()