summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-12-03 13:54:23 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-12-03 13:54:34 (GMT)
commit9ecb24b5a7c5c41ff16f4445223b0b0a3d6966be (patch)
tree4dea56aba60e22866867416eec2cb83d110b59be /Tests
parentcf32ffda05b780a2f13f7e79126b22ed59c63dc8 (diff)
parent13a7ae2194d44f955712d65fecf0b741049da00e (diff)
downloadCMake-9ecb24b5a7c5c41ff16f4445223b0b0a3d6966be.zip
CMake-9ecb24b5a7c5c41ff16f4445223b0b0a3d6966be.tar.gz
CMake-9ecb24b5a7c5c41ff16f4445223b0b0a3d6966be.tar.bz2
Merge topic 'vs-csproj-scripts'
13a7ae2194 VS: Revert "Add missing label in C# project-build events" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6781
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/VSManagedCustomCommand/CMakeLists.txt15
-rw-r--r--Tests/VSManagedCustomCommand/example.txt4
3 files changed, 20 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index d2cfa3f..4540b39 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2237,6 +2237,7 @@ if(BUILD_TESTING)
if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio 9 "
AND NOT CMAKE_GENERATOR_TOOLSET)
ADD_TEST_MACRO(VSWindowsFormsResx VSWindowsFormsResx)
+ ADD_TEST_MACRO(VSManagedCustomCommand)
endif()
add_test(VSExternalInclude ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/VSManagedCustomCommand/CMakeLists.txt b/Tests/VSManagedCustomCommand/CMakeLists.txt
new file mode 100644
index 0000000..2228875
--- /dev/null
+++ b/Tests/VSManagedCustomCommand/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.20)
+project(VSManagedCustomCommand CXX)
+
+add_custom_command(OUTPUT middle.txt
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/example.txt ${CMAKE_CURRENT_BINARY_DIR}/middle.txt
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/example.txt
+ )
+
+add_custom_command(OUTPUT example.cxx
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/middle.txt ${CMAKE_CURRENT_BINARY_DIR}/example.cxx
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/middle.txt
+ )
+
+add_library(example SHARED example.cxx)
+set_property(TARGET example PROPERTY COMMON_LANGUAGE_RUNTIME "")
diff --git a/Tests/VSManagedCustomCommand/example.txt b/Tests/VSManagedCustomCommand/example.txt
new file mode 100644
index 0000000..05f95f1
--- /dev/null
+++ b/Tests/VSManagedCustomCommand/example.txt
@@ -0,0 +1,4 @@
+__declspec(dllexport) int example()
+{
+ return 0;
+}