summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsTarget.cmake
diff options
context:
space:
mode:
authorSumit Bhardwaj <bhardwajs@outlook.com>2021-12-15 16:21:34 (GMT)
committerSumit Bhardwaj <bhardwajs@outlook.com>2021-12-21 17:35:49 (GMT)
commit0eea32a376fc54b198fa4690ca57b829a2d14baa (patch)
treec786935ed240c0857c0e82d87ffc27149fdade33 /Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsTarget.cmake
parenta450cc9533ac8a54d14ec5e0cbf6b379a2014e7a (diff)
downloadCMake-0eea32a376fc54b198fa4690ca57b829a2d14baa.zip
CMake-0eea32a376fc54b198fa4690ca57b829a2d14baa.tar.gz
CMake-0eea32a376fc54b198fa4690ca57b829a2d14baa.tar.bz2
VS: Add DOTNET_SDK property to generate SDK-style C# projects
Changes in cmVisualStudio10TargetGenerator::Generate to write .Net SDK-style project for VS generators VS 19 and above. Also adds documentation and tests. Issue: #20227
Diffstat (limited to 'Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsTarget.cmake')
-rw-r--r--Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsTarget.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsTarget.cmake b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsTarget.cmake
new file mode 100644
index 0000000..f5cd317
--- /dev/null
+++ b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsTarget.cmake
@@ -0,0 +1,12 @@
+enable_language(CSharp)
+
+if(NOT CMAKE_CSharp_COMPILER)
+ return()
+endif()
+
+set(CMAKE_DOTNET_SDK "Microsoft.NET.Sdk")
+add_library(foo SHARED lib1.cs)
+add_custom_command(TARGET foo
+ PRE_BUILD
+ COMMAND echo "This shouldn't happen!"
+ VERBATIM)