diff options
author | Brad King <brad.king@kitware.com> | 2017-01-16 16:01:29 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-01-16 16:01:29 (GMT) |
commit | 47d391d71d611c5129c6914ad77b34dc4bb79d75 (patch) | |
tree | 948d379f4a8501a011be144ad6220c542dd9b074 /Tests | |
parent | a67baf0af0f5c94eeab400a163b8b2f6824d7bab (diff) | |
parent | 397b854620fc1ab3d8427ebeb5b7e4659c4f9128 (diff) | |
download | CMake-47d391d71d611c5129c6914ad77b34dc4bb79d75.zip CMake-47d391d71d611c5129c6914ad77b34dc4bb79d75.tar.gz CMake-47d391d71d611c5129c6914ad77b34dc4bb79d75.tar.bz2 |
Merge topic 'csharp_simple'
397b8546 VS: added documentation for C# support
a7dd8e66 VS: added support for C# (for Visual Studio 2010, 2012, 2013, 2015)
6fda6005 VS: renamed target property VS_USER_PROPS_CXX to VS_USER_PROPS
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/CSharpOnly/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/CSharpOnly/csharponly.cs | 15 | ||||
-rw-r--r-- | Tests/CSharpOnly/lib1.cs | 10 | ||||
-rw-r--r-- | Tests/CSharpOnly/lib2.cs | 10 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCustomProps.cmake | 2 |
6 files changed, 49 insertions, 1 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 73eef9a..4945b31 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -325,6 +325,9 @@ if(BUILD_TESTING) endif() endif() + if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^789]|[789][0-9])") + ADD_TEST_MACRO(CSharpOnly CSharpOnly) + endif() ADD_TEST_MACRO(COnly COnly) ADD_TEST_MACRO(CxxOnly CxxOnly) 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() + {} + } +} diff --git a/Tests/RunCMake/VS10Project/VsCustomProps.cmake b/Tests/RunCMake/VS10Project/VsCustomProps.cmake index af52a3e..fbbcfcf 100644 --- a/Tests/RunCMake/VS10Project/VsCustomProps.cmake +++ b/Tests/RunCMake/VS10Project/VsCustomProps.cmake @@ -4,4 +4,4 @@ add_library(foo foo.cpp) set(props_file "${CMAKE_CURRENT_SOURCE_DIR}/my.props") set_target_properties(foo PROPERTIES - VS_USER_PROPS_CXX "${props_file}") + VS_USER_PROPS "${props_file}") |