Don't allow include() of export(EXPORT) file at configure time.
As a new feature it does not need to participate in CMP0024. Store cmExportBuildFileGenerator instances which correspond to the export(EXPORT) signature in a second map which does not own the pointers. This avoids the need to add cmExportBuildFileGenerator and dependencies to the bootstrap system.
This commit is contained in:
parent
faedd2bea9
commit
84fac67f90
|
@ -236,8 +236,14 @@ bool cmExportCommand
|
||||||
{
|
{
|
||||||
ebfg->AddConfiguration("");
|
ebfg->AddConfiguration("");
|
||||||
}
|
}
|
||||||
|
if (this->ExportSet)
|
||||||
gg->AddBuildExportSet(ebfg);
|
{
|
||||||
|
gg->AddBuildExportExportSet(ebfg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gg->AddBuildExportSet(ebfg);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,13 @@ void cmGlobalGenerator::AddBuildExportSet(cmExportBuildFileGenerator* gen)
|
||||||
this->BuildExportSets[gen->GetMainExportFileName()] = gen;
|
this->BuildExportSets[gen->GetMainExportFileName()] = gen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cmGlobalGenerator::AddBuildExportExportSet(cmExportBuildFileGenerator* gen)
|
||||||
|
{
|
||||||
|
this->BuildExportSets[gen->GetMainExportFileName()] = gen;
|
||||||
|
this->BuildExportExportSets[gen->GetMainExportFileName()] = gen;
|
||||||
|
}
|
||||||
|
|
||||||
bool cmGlobalGenerator::GenerateImportFile(const std::string &file)
|
bool cmGlobalGenerator::GenerateImportFile(const std::string &file)
|
||||||
{
|
{
|
||||||
std::map<std::string, cmExportBuildFileGenerator*>::iterator it
|
std::map<std::string, cmExportBuildFileGenerator*>::iterator it
|
||||||
|
@ -207,7 +214,12 @@ cmGlobalGenerator::IsExportedTargetsFile(const std::string &filename) const
|
||||||
{
|
{
|
||||||
const std::map<std::string, cmExportBuildFileGenerator*>::const_iterator it
|
const std::map<std::string, cmExportBuildFileGenerator*>::const_iterator it
|
||||||
= this->BuildExportSets.find(filename);
|
= this->BuildExportSets.find(filename);
|
||||||
return it != this->BuildExportSets.end();
|
if (it == this->BuildExportSets.end())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this->BuildExportExportSets.find(filename)
|
||||||
|
== this->BuildExportExportSets.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the make program for the generator, required for try compiles
|
// Find the make program for the generator, required for try compiles
|
||||||
|
|
|
@ -311,6 +311,7 @@ public:
|
||||||
std::map<std::string, cmExportBuildFileGenerator*>& GetBuildExportSets()
|
std::map<std::string, cmExportBuildFileGenerator*>& GetBuildExportSets()
|
||||||
{return this->BuildExportSets;}
|
{return this->BuildExportSets;}
|
||||||
void AddBuildExportSet(cmExportBuildFileGenerator*);
|
void AddBuildExportSet(cmExportBuildFileGenerator*);
|
||||||
|
void AddBuildExportExportSet(cmExportBuildFileGenerator*);
|
||||||
bool IsExportedTargetsFile(const std::string &filename) const;
|
bool IsExportedTargetsFile(const std::string &filename) const;
|
||||||
bool GenerateImportFile(const std::string &file);
|
bool GenerateImportFile(const std::string &file);
|
||||||
cmExportBuildFileGenerator*
|
cmExportBuildFileGenerator*
|
||||||
|
@ -375,6 +376,7 @@ protected:
|
||||||
// Sets of named target exports
|
// Sets of named target exports
|
||||||
cmExportSetMap ExportSets;
|
cmExportSetMap ExportSets;
|
||||||
std::map<std::string, cmExportBuildFileGenerator*> BuildExportSets;
|
std::map<std::string, cmExportBuildFileGenerator*> BuildExportSets;
|
||||||
|
std::map<std::string, cmExportBuildFileGenerator*> BuildExportExportSets;
|
||||||
|
|
||||||
// Manifest of all targets that will be built for each configuration.
|
// Manifest of all targets that will be built for each configuration.
|
||||||
// This is computed just before local generators generate.
|
// This is computed just before local generators generate.
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
|
@ -0,0 +1,6 @@
|
||||||
|
CMake Error at ExportExportInclude.cmake:6 \(include\):
|
||||||
|
include could not find load file:
|
||||||
|
|
||||||
|
.*/Tests/RunCMake/include/ExportExportInclude-build/theTargets.cmake
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
add_library(iface INTERFACE)
|
||||||
|
install(TARGETS iface EXPORT ifaceExport)
|
||||||
|
|
||||||
|
export(EXPORT ifaceExport FILE "${CMAKE_CURRENT_BINARY_DIR}/theTargets.cmake")
|
||||||
|
include("${CMAKE_CURRENT_BINARY_DIR}/theTargets.cmake")
|
|
@ -4,3 +4,4 @@ run_cmake(EmptyString)
|
||||||
run_cmake(EmptyStringOptional)
|
run_cmake(EmptyStringOptional)
|
||||||
run_cmake(CMP0024-WARN)
|
run_cmake(CMP0024-WARN)
|
||||||
run_cmake(CMP0024-NEW)
|
run_cmake(CMP0024-NEW)
|
||||||
|
run_cmake(ExportExportInclude)
|
||||||
|
|
Loading…
Reference in New Issue