From 6f50a04cc1c4584472f850e06daad7ae20af45c4 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 23 Sep 2012 18:40:40 +0200 Subject: exports: define a CMAKE_FIND_PACKAGE_NAME var set by find_package() This way the name of the searched package can be accessed in find-modules, config-files and more importantly in generated target export files. This is now used when a target export file detects that a required target does not exist. Alex --- Source/cmExportFileGenerator.cxx | 9 ++++++++- Source/cmFindPackageCommand.cxx | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 5d95668..8dffae4 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -389,8 +389,15 @@ void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os, for(unsigned int i=0; iAddFindDefinition("CMAKE_FIND_PACKAGE_NAME", this->Name.c_str()); + // Store the list of components. std::string components_var = this->Name + "_FIND_COMPONENTS"; this->AddFindDefinition(components_var.c_str(), components.c_str()); -- cgit v0.12