diff options
author | Calum Robinson <calum.robinson@sias.com> | 2024-09-17 15:30:44 (GMT) |
---|---|---|
committer | Calum Robinson <calum.robinson@sias.com> | 2024-09-18 17:26:27 (GMT) |
commit | fd668186530d88340ecf32d2b55859a8cf6a8cb4 (patch) | |
tree | 3f226aeeb17a19a791c41d384089d7dc7750b93f /Tests | |
parent | b69b5a94d1a30a71b76b05a025b13a505dcda67b (diff) | |
download | CMake-fd668186530d88340ecf32d2b55859a8cf6a8cb4.zip CMake-fd668186530d88340ecf32d2b55859a8cf6a8cb4.tar.gz CMake-fd668186530d88340ecf32d2b55859a8cf6a8cb4.tar.bz2 |
VS: Fix custom commands for DOTNET_SDK builds
Fixes: #23723
Diffstat (limited to 'Tests')
5 files changed, 4 insertions, 11 deletions
diff --git a/Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake b/Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake index 68a6d5c..276451d 100644 --- a/Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake +++ b/Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake @@ -1,7 +1,6 @@ cmake_policy(SET CMP0053 NEW) include(RunCMake) -run_cmake(VsDotnetSdkCustomCommandsSource) run_cmake(VsDotnetSdkStartupObject) run_cmake(VsDotnetSdkDefines) run_cmake(DotnetSdkVariables) @@ -30,3 +29,4 @@ endfunction() runCmakeAndBuild(VsDotnetSdkCustomCommandsTarget) runCmakeAndBuild(VsDotnetSdkNugetRestore) +runCmakeAndBuild(VsDotnetSdkCustomCommandsSource) diff --git a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-build-stdout.txt b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-build-stdout.txt new file mode 100644 index 0000000..9afaa2b --- /dev/null +++ b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-build-stdout.txt @@ -0,0 +1 @@ +Generating bar.cs diff --git a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-result.txt b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-result.txt deleted file mode 100644 index e69de29..0000000 --- a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-result.txt +++ /dev/null diff --git a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-stderr.txt b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-stderr.txt deleted file mode 100644 index 90af627..0000000 --- a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Error in CMakeLists.txt: - The target "foo" does not currently support add_custom_command as the - Visual Studio generators have not yet learned how to generate custom - commands in .Net SDK-style projects. - - -CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource.cmake b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource.cmake index af18946..d6166db 100644 --- a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource.cmake +++ b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkCustomCommandsSource.cmake @@ -7,9 +7,8 @@ endif() set(CMAKE_DOTNET_SDK "Microsoft.NET.Sdk") add_custom_command( OUTPUT bar.cs - COMMAND copy /A ${CMAKE_CURRENT_SOURCE_DIR}/lib1.cs - bar.cs - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib1.cs + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/lib1.cs" bar.cs + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/lib1.cs" VERBATIM) add_library(foo SHARED bar.cs) |