summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
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 ecb54c7..36bbc62 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2236,6 +2236,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;
+}