diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index ef4ea3800..e55f1683f 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -754,29 +754,46 @@ void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os, { if (missingTargets.empty()) { + os << "# This file does not depend on other imported targets which have\n" + "# been exported from the same project but in a separate " + "export set.\n\n"; return; } os << "# Make sure the targets which have been exported in some other \n" - "# export set exist.\n"; + "# export set exist.\n" + "unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)\n" + "foreach(_target "; std::set emitted; for(unsigned int i=0; i