summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-22 14:47:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-11-22 14:47:59 (GMT)
commit62172b4ab7dd06375b95f1ee9d467c015acd6c01 (patch)
tree3a6e8bf8cecd107f3954c886ef30bd4376238712 /Tests
parenta449a840bdbb321433c3e5049323628816e8032f (diff)
parent26d813092bffdcda77976ab5ba59c114e3e2fda5 (diff)
downloadCMake-62172b4ab7dd06375b95f1ee9d467c015acd6c01.zip
CMake-62172b4ab7dd06375b95f1ee9d467c015acd6c01.tar.gz
CMake-62172b4ab7dd06375b95f1ee9d467c015acd6c01.tar.bz2
Merge topic 'custom-command-comment-genex'
26d813092b add_custom_{command,target}: add genex support for COMMENT 60a5a39022 cmCustomCommandGenerator: refactor GetComment to return std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7887
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/add_custom_command/CommentGenex-build-stdout.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/CommentGenex.cmake9
-rw-r--r--Tests/RunCMake/add_custom_command/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/add_custom_target/CommentGenex-build-stdout.txt1
-rw-r--r--Tests/RunCMake/add_custom_target/CommentGenex.cmake6
-rw-r--r--Tests/RunCMake/add_custom_target/RunCMakeTest.cmake9
6 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/add_custom_command/CommentGenex-build-stdout.txt b/Tests/RunCMake/add_custom_command/CommentGenex-build-stdout.txt
new file mode 100644
index 0000000..bf49657
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/CommentGenex-build-stdout.txt
@@ -0,0 +1 @@
+lorem ipsum, 01
diff --git a/Tests/RunCMake/add_custom_command/CommentGenex.cmake b/Tests/RunCMake/add_custom_command/CommentGenex.cmake
new file mode 100644
index 0000000..f517392
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/CommentGenex.cmake
@@ -0,0 +1,9 @@
+add_custom_target(helper)
+set_property(TARGET helper PROPERTY MY_TEXT "lorem ipsum")
+add_custom_command(
+ OUTPUT out.txt
+ COMMAND ${CMAKE_COMMAND} -E echo true
+ COMMENT "$<TARGET_PROPERTY:helper,MY_TEXT>$<COMMA> $<STREQUAL:foo,bar>$<EQUAL:42,42>"
+)
+set_property(SOURCE out.txt PROPERTY SYMBOLIC 1)
+add_custom_target(main ALL DEPENDS out.txt)
diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
index ad6b258..6c677c0 100644
--- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
@@ -60,3 +60,12 @@ function(test_genex name)
endfunction()
test_genex(TargetGenexEvent)
+
+if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
+ block()
+ run_cmake(CommentGenex)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CommentGenex-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(CommentGenex-build ${CMAKE_COMMAND} --build .)
+ endblock()
+endif()
diff --git a/Tests/RunCMake/add_custom_target/CommentGenex-build-stdout.txt b/Tests/RunCMake/add_custom_target/CommentGenex-build-stdout.txt
new file mode 100644
index 0000000..bf49657
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/CommentGenex-build-stdout.txt
@@ -0,0 +1 @@
+lorem ipsum, 01
diff --git a/Tests/RunCMake/add_custom_target/CommentGenex.cmake b/Tests/RunCMake/add_custom_target/CommentGenex.cmake
new file mode 100644
index 0000000..6e6706e
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/CommentGenex.cmake
@@ -0,0 +1,6 @@
+add_custom_target(helper)
+set_property(TARGET helper PROPERTY MY_TEXT "lorem ipsum")
+add_custom_target(main ALL
+ COMMAND ${CMAKE_COMMAND} -E true
+ COMMENT "$<TARGET_PROPERTY:helper,MY_TEXT>$<COMMA> $<STREQUAL:foo,bar>$<EQUAL:42,42>"
+)
diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
index 22a9ed4..f43779b 100644
--- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
@@ -23,3 +23,12 @@ function(run_TargetOrder)
run_cmake_command(TargetOrder-build ${CMAKE_COMMAND} --build . -- ${build_flags})
endfunction()
run_TargetOrder()
+
+if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
+ block()
+ run_cmake(CommentGenex)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CommentGenex-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(CommentGenex-build ${CMAKE_COMMAND} --build .)
+ endblock()
+endif()