mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -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
9 lines
236 B
CMake
9 lines
236 B
CMake
if (${CMAKE_ARGC} LESS 4)
|
|
message(FATAL_ERROR "Too few arguments")
|
|
endif()
|
|
set(output "${CMAKE_ARGV3}")
|
|
if(EXISTS ${output})
|
|
message(FATAL_ERROR "${output} already exists")
|
|
endif()
|
|
file(WRITE ${output} "int main() { return 0; }\n")
|