summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-09-01 21:40:18 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-09-02 16:59:59 (GMT)
commita9fd3a107dc4bc34b8d2822b9153ee0ab9e02ea8 (patch)
tree9ca32f0f90fd36c8d3328b64278dcb390cf79bb0 /Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake
parentf1199bdc96d255fbd10772b64d6ff1c64490bb57 (diff)
downloadCMake-a9fd3a107dc4bc34b8d2822b9153ee0ab9e02ea8.zip
CMake-a9fd3a107dc4bc34b8d2822b9153ee0ab9e02ea8.tar.gz
CMake-a9fd3a107dc4bc34b8d2822b9153ee0ab9e02ea8.tar.bz2
Ninja Multi-Config: Fix dependencies of utility targets
Fixes: #21118
Diffstat (limited to 'Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake')
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake12
1 files changed, 11 insertions, 1 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake
index b2b24e8..b6f1152 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake
@@ -34,6 +34,16 @@ add_subdirectory(CustomCommandsAndTargetsSubdir)
create_targets(Top)
+add_executable(RootExe main.c)
+add_custom_target(RootCustom COMMAND ${CMAKE_COMMAND} -E touch Root.txt BYPRODUCTS Root.txt)
+add_executable(LeafExe main.c)
+add_custom_target(LeafCustom COMMAND ${CMAKE_COMMAND} -E touch Leaf.txt BYPRODUCTS Leaf.txt DEPENDS RootCustom RootExe)
+add_dependencies(LeafExe RootExe RootCustom)
+file(APPEND "${CMAKE_BINARY_DIR}/target_files_custom.cmake"
+"set(TARGET_BYPRODUCTS_LeafCustom [==[${CMAKE_CURRENT_BINARY_DIR}/Leaf.txt]==])
+set(TARGET_BYPRODUCTS_RootCustom [==[${CMAKE_CURRENT_BINARY_DIR}/Root.txt]==])
+")
+
include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
-generate_output_files(TopPostBuild SubdirPostBuild)
+generate_output_files(TopPostBuild SubdirPostBuild RootExe LeafExe)
file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "include(\${CMAKE_CURRENT_LIST_DIR}/target_files_custom.cmake)\n")