diff options
author | Brad King <brad.king@kitware.com> | 2018-10-31 13:35:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-31 13:36:38 (GMT) |
commit | 3065a8a793705369da4dcaa2c85f558a8e5f8a35 (patch) | |
tree | 6d2e14af3781b56a6aa3a809035be5841d01ad05 /Tests | |
parent | 09e36f9978609eb7efda101590ba685df850f5c8 (diff) | |
parent | a56edad6d61268204af8228b8d58fa26d8f72269 (diff) | |
download | CMake-3065a8a793705369da4dcaa2c85f558a8e5f8a35.zip CMake-3065a8a793705369da4dcaa2c85f558a8e5f8a35.tar.gz CMake-3065a8a793705369da4dcaa2c85f558a8e5f8a35.tar.bz2 |
Merge branch 'fix-custom-target-with-csharp' into release-3.13
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") |