summaryrefslogtreecommitdiffstats
path: root/Modules/UseSWIG.cmake
diff options
context:
space:
mode:
authorRishi Theivendran <rishi.theivendran@rohde-schwarz.com>2018-06-08 20:15:18 (GMT)
committerBrad King <brad.king@kitware.com>2018-06-12 15:34:58 (GMT)
commit0c2fb4c8964b6164c44e8641c8c9225369c0228b (patch)
tree732c27065bfe1e317da5dd95d12e6d85bd16f215 /Modules/UseSWIG.cmake
parent90ebc32d9e7400a590973b30c99f2986bcb2b755 (diff)
downloadCMake-0c2fb4c8964b6164c44e8641c8c9225369c0228b.zip
CMake-0c2fb4c8964b6164c44e8641c8c9225369c0228b.tar.gz
CMake-0c2fb4c8964b6164c44e8641c8c9225369c0228b.tar.bz2
UseSWIG: Add CSHARP variant for wrapper files
Issue: #18065 Fixes: #18066
Diffstat (limited to 'Modules/UseSWIG.cmake')
-rw-r--r--Modules/UseSWIG.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 8713cd8..98a7612 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()