diff options
author | Brad King <brad.king@kitware.com> | 2018-11-01 11:36:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-11-01 11:36:39 (GMT) |
commit | d955b4f753d450ec10a2f928fcca1a91a50816ce (patch) | |
tree | 518196d26a2930e7fb89531f8ca235f26c7bade3 /Tests | |
parent | 75b85133d8cccb5d2680b0817d8720c6860238b0 (diff) | |
parent | 9040df31e2da7db351d76dcc72568d44d0223f92 (diff) | |
download | CMake-d955b4f753d450ec10a2f928fcca1a91a50816ce.zip CMake-d955b4f753d450ec10a2f928fcca1a91a50816ce.tar.gz CMake-d955b4f753d450ec10a2f928fcca1a91a50816ce.tar.bz2 |
Merge topic 'fix-custom-target-with-csharp'
9040df31e2 Merge branch 'backport-fix-custom-target-with-csharp'
1acd1c2b50 CSharp: Fix regression in VS project type selection for custom target
a56edad6d6 CSharp: Fix regression in VS project type selection for custom target
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2549
Diffstat (limited to 'Tests')
4 files changed, 15 insertions, 2 deletions
diff --git a/Tests/CSharpOnly/CMakeLists.txt b/Tests/CSharpOnly/CMakeLists.txt index 84b58ca..82049c7 100644 --- a/Tests/CSharpOnly/CMakeLists.txt +++ b/Tests/CSharpOnly/CMakeLists.txt @@ -9,5 +9,5 @@ add_executable(CSharpOnly csharponly.cs) target_link_libraries(CSharpOnly lib1 lib2) -add_custom_target(CSharpCustom SOURCES empty.cs) -add_custom_target(custom.cs DEPENDS empty.txt) +add_custom_target(CSharpCustom ALL SOURCES empty.cs) +add_custom_target(custom.cs ALL DEPENDS empty.txt) diff --git a/Tests/RunCMake/CSharpCustomCommand/RunCMakeTest.cmake b/Tests/RunCMake/CSharpCustomCommand/RunCMakeTest.cmake index fa5618a..ab3e51b 100644 --- a/Tests/RunCMake/CSharpCustomCommand/RunCMakeTest.cmake +++ b/Tests/RunCMake/CSharpCustomCommand/RunCMakeTest.cmake @@ -1,5 +1,13 @@ include(RunCMake) +function(run_TargetWithCommand) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TargetWithCommand-build) + run_cmake(TargetWithCommand) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(TargetWithCommand-build ${CMAKE_COMMAND} --build . --config Debug) +endfunction() +run_TargetWithCommand() + # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CommandWithOutput-build) set(RunCMake_TEST_NO_CLEAN 1) diff --git a/Tests/RunCMake/CSharpCustomCommand/TargetWithCommand-build-stdout.txt b/Tests/RunCMake/CSharpCustomCommand/TargetWithCommand-build-stdout.txt new file mode 100644 index 0000000..c212a8f --- /dev/null +++ b/Tests/RunCMake/CSharpCustomCommand/TargetWithCommand-build-stdout.txt @@ -0,0 +1 @@ +Custom target with CSharp source diff --git a/Tests/RunCMake/CSharpCustomCommand/TargetWithCommand.cmake b/Tests/RunCMake/CSharpCustomCommand/TargetWithCommand.cmake new file mode 100644 index 0000000..fdaea5c --- /dev/null +++ b/Tests/RunCMake/CSharpCustomCommand/TargetWithCommand.cmake @@ -0,0 +1,4 @@ +enable_language(CSharp) + +add_custom_target(drive ALL SOURCES dummy.cs + COMMAND ${CMAKE_COMMAND} -E echo "Custom target with CSharp source") |