From 11d0c662069e3fd74cb908f714274eeb05f1a14d Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Mon, 11 Feb 2013 22:18:48 +0100 Subject: [PATCH] export files: rewrite the code for checking required targets Instead of generating a whole bunch of repeated if-statements now a foreach()-loop is generated in the targets-file. Also now a comment is inserted in the generated file if no targets from other export sets are used, so if somebody looks at the file he can see whether the information about missing imported targets has been generated or not. Alex --- Source/cmExportFileGenerator.cxx | 43 ++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 13 deletions(-) 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