From 608d6bba89a5588c370dda6d6d46365c24168b55 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 9 Dec 2010 10:12:12 -0500 Subject: [PATCH] Fix parallel "make install" of CMake itself Avoid tracing dependencies of GLOBAL_TARGET targets. The build system generators are not designed to handle any dependencies that may be discovered. Global targets are only generated by CMake and never have commands that reference targets built in the project anyway. The exception is when building CMake itself there is a special case to use the just-built "cmake" binary in the "install" target so that CMake can replace itself on Windows. Even in this special case we do not want to let the "install" target depend on the "cmake" target. Doing so breaks cases like "make -j4 install". --- Source/cmTarget.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ca61b1fc3..689550a76 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1450,6 +1450,15 @@ cmTargetTraceDependencies //---------------------------------------------------------------------------- void cmTarget::TraceDependencies(const char* vsProjectFile) { + // CMake-generated targets have no dependencies to trace. Normally tracing + // would find nothing anyway, but when building CMake itself the "install" + // target command ends up referencing the "cmake" target but we do not + // really want the dependency because "install" depend on "all" anyway. + if(this->GetType() == cmTarget::GLOBAL_TARGET) + { + return; + } + // Use a helper object to trace the dependencies. cmTargetTraceDependencies tracer(this, this->Internal.Get(), vsProjectFile); tracer.Trace();