summaryrefslogtreecommitdiffstats
path: root/Tests/CSharpOnly
diff options
context:
space:
mode:
authorMichael Stürmer <michael.stuermer@schaeffler.com>2017-01-09 15:34:13 (GMT)
committerMichael Stürmer <michael.stuermer@schaeffler.com>2017-01-13 08:28:13 (GMT)
commita7dd8e669289e7b78ebc05b5d337052f32582038 (patch)
tree5142590a9f2f520e4dc0f9e70524d633c8f3a023 /Tests/CSharpOnly
parent6fda6005b306cc4a1e9e9e66d9cd4525fc623f73 (diff)
downloadCMake-a7dd8e669289e7b78ebc05b5d337052f32582038.zip
CMake-a7dd8e669289e7b78ebc05b5d337052f32582038.tar.gz
CMake-a7dd8e669289e7b78ebc05b5d337052f32582038.tar.bz2
VS: added support for C# (for Visual Studio 2010, 2012, 2013, 2015)
Diffstat (limited to 'Tests/CSharpOnly')
-rw-r--r--Tests/CSharpOnly/CMakeLists.txt10
-rw-r--r--Tests/CSharpOnly/csharponly.cs15
-rw-r--r--Tests/CSharpOnly/lib1.cs10
-rw-r--r--Tests/CSharpOnly/lib2.cs10
4 files changed, 45 insertions, 0 deletions
diff --git a/Tests/CSharpOnly/CMakeLists.txt b/Tests/CSharpOnly/CMakeLists.txt
new file mode 100644
index 0000000..0e3e39e
--- /dev/null
+++ b/Tests/CSharpOnly/CMakeLists.txt
@@ -0,0 +1,10 @@
+# a simple CSharp only test case
+project (CSharpOnly CSharp)
+
+# C# does not make any difference between STATIC and SHARED libs
+add_library(lib1 STATIC lib1.cs)
+add_library(lib2 SHARED lib2.cs)
+
+add_executable(CSharpOnly csharponly.cs)
+
+target_link_libraries(CSharpOnly lib1 lib2)
diff --git a/Tests/CSharpOnly/csharponly.cs b/Tests/CSharpOnly/csharponly.cs
new file mode 100644
index 0000000..ad4641a
--- /dev/null
+++ b/Tests/CSharpOnly/csharponly.cs
@@ -0,0 +1,15 @@
+namespace CSharpOnly
+{
+ class CSharpOnly
+ {
+ public static void Main(string[] args)
+ {
+ int val = Lib1.getResult();
+
+ Lib2 l = new Lib2();
+ val = l.myVal;
+
+ return;
+ }
+ }
+}
diff --git a/Tests/CSharpOnly/lib1.cs b/Tests/CSharpOnly/lib1.cs
new file mode 100644
index 0000000..7a7ae10
--- /dev/null
+++ b/Tests/CSharpOnly/lib1.cs
@@ -0,0 +1,10 @@
+namespace CSharpOnly
+{
+ public class Lib1
+ {
+ public static int getResult()
+ {
+ return 23;
+ }
+ }
+}
diff --git a/Tests/CSharpOnly/lib2.cs b/Tests/CSharpOnly/lib2.cs
new file mode 100644
index 0000000..b4b38ce
--- /dev/null
+++ b/Tests/CSharpOnly/lib2.cs
@@ -0,0 +1,10 @@
+namespace CSharpOnly
+{
+ public class Lib2
+ {
+ public int myVal = 42;
+
+ public Lib2()
+ {}
+ }
+}