mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 21:00:17 -06:00
If a custom command is assigned to multiple targets, generate the build rule only in the least-dependent `.vcxproj` file. Otherwise MSBuild will run the command on the first build of a dependent target even if its dependencies already brought the command up to date (in order to populates its build log). Generate targets in least-to-most-dependent order, and assign a custom command to the least dependent target. Added cmLocalVisualStudio10Generator::GenerateTargetsDepthFirst to call cmVisualStudio10TargetGenerator::Generate in least-dependent order. Moved SourcesVisited from cmVisualStudio10TargetGenerator to cmLocalVisualStudio10Generator to avoid attaching a custom command to multiple targets among the local generator. Fixes: #16767
24 lines
683 B
CMake
24 lines
683 B
CMake
include(RunCMake)
|
|
|
|
run_cmake(AppendNoOutput)
|
|
run_cmake(AppendNotOutput)
|
|
run_cmake(BadArgument)
|
|
run_cmake(NoArguments)
|
|
run_cmake(NoOutputOrTarget)
|
|
run_cmake(OutputAndTarget)
|
|
run_cmake(SourceByproducts)
|
|
run_cmake(SourceUsesTerminal)
|
|
run_cmake(TargetImported)
|
|
run_cmake(TargetNotInDir)
|
|
|
|
if(${RunCMake_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])")
|
|
run_cmake(RemoveEmptyCommands)
|
|
endif()
|
|
|
|
run_cmake(AssigningMultipleTargets)
|
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AssigningMultipleTargets-build)
|
|
set(RunCMake_TEST_NO_CLEAN 1)
|
|
run_cmake_command(AssigningMultipleTargets-build ${CMAKE_COMMAND} --build .)
|
|
unset(RunCMake_TEST_BINARY_DIR)
|
|
unset(RunCMake_TEST_NO_CLEAN)
|