mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-20 21:28:23 -05:00
Autogen: Pass absolute include path in info file
This commit is contained in:
@@ -244,6 +244,21 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
|
|||||||
// Working directory
|
// Working directory
|
||||||
this->DirWork = cbd;
|
this->DirWork = cbd;
|
||||||
cmSystemTools::ConvertToUnixSlashes(this->DirWork);
|
cmSystemTools::ConvertToUnixSlashes(this->DirWork);
|
||||||
|
|
||||||
|
// Include directory
|
||||||
|
this->DirInclude = this->DirBuild;
|
||||||
|
this->DirInclude += "/include";
|
||||||
|
if (this->MultiConfig) {
|
||||||
|
this->DirInclude += "_$<CONFIG>";
|
||||||
|
}
|
||||||
|
if (this->MultiConfig) {
|
||||||
|
for (std::string const& cfg : this->ConfigsList) {
|
||||||
|
std::string& dir = this->DirConfigInclude[cfg];
|
||||||
|
dir = this->DirBuild;
|
||||||
|
dir += "/include_";
|
||||||
|
dir += cfg;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Autogen files
|
// Autogen files
|
||||||
@@ -305,12 +320,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
|
|||||||
// Add autogen includes directory to the origin target INCLUDE_DIRECTORIES
|
// Add autogen includes directory to the origin target INCLUDE_DIRECTORIES
|
||||||
if (this->Moc.Enabled || this->Uic.Enabled ||
|
if (this->Moc.Enabled || this->Uic.Enabled ||
|
||||||
(this->Rcc.Enabled && this->MultiConfig)) {
|
(this->Rcc.Enabled && this->MultiConfig)) {
|
||||||
std::string includeDir = this->DirBuild;
|
this->Target->AddIncludeDirectory(this->DirInclude, true);
|
||||||
includeDir += "/include";
|
|
||||||
if (this->MultiConfig) {
|
|
||||||
includeDir += "_$<CONFIG>";
|
|
||||||
}
|
|
||||||
this->Target->AddIncludeDirectory(includeDir, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Acquire rcc executable and features
|
// Acquire rcc executable and features
|
||||||
@@ -833,15 +843,6 @@ bool cmQtAutoGenInitializer::SetupCustomTargets()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configuration include directories
|
|
||||||
std::string includeDir = "include";
|
|
||||||
std::map<std::string, std::string> includeDirs;
|
|
||||||
for (std::string const& cfg : this->ConfigsList) {
|
|
||||||
std::string& dir = includeDirs[cfg];
|
|
||||||
dir = "include_";
|
|
||||||
dir += cfg;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate autogen target info file
|
// Generate autogen target info file
|
||||||
if (this->Moc.Enabled || this->Uic.Enabled) {
|
if (this->Moc.Enabled || this->Uic.Enabled) {
|
||||||
if (this->Moc.Enabled) {
|
if (this->Moc.Enabled) {
|
||||||
@@ -913,9 +914,9 @@ bool cmQtAutoGenInitializer::SetupCustomTargets()
|
|||||||
MfDef("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE"));
|
MfDef("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE"));
|
||||||
CWrite("AM_BUILD_DIR", this->DirBuild);
|
CWrite("AM_BUILD_DIR", this->DirBuild);
|
||||||
if (this->MultiConfig) {
|
if (this->MultiConfig) {
|
||||||
CWriteMap("AM_INCLUDE_DIR", includeDirs);
|
CWriteMap("AM_INCLUDE_DIR", this->DirConfigInclude);
|
||||||
} else {
|
} else {
|
||||||
CWrite("AM_INCLUDE_DIR", includeDir);
|
CWrite("AM_INCLUDE_DIR", this->DirInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
ofs << "# Files\n";
|
ofs << "# Files\n";
|
||||||
@@ -1014,9 +1015,9 @@ bool cmQtAutoGenInitializer::SetupCustomTargets()
|
|||||||
ofs << "# Directories\n";
|
ofs << "# Directories\n";
|
||||||
CWrite("ARCC_BUILD_DIR", this->DirBuild);
|
CWrite("ARCC_BUILD_DIR", this->DirBuild);
|
||||||
if (this->MultiConfig) {
|
if (this->MultiConfig) {
|
||||||
CWriteMap("ARCC_INCLUDE_DIR", includeDirs);
|
CWriteMap("ARCC_INCLUDE_DIR", this->DirConfigInclude);
|
||||||
} else {
|
} else {
|
||||||
CWrite("ARCC_INCLUDE_DIR", includeDir);
|
CWrite("ARCC_INCLUDE_DIR", this->DirInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
ofs << "# Rcc executable\n";
|
ofs << "# Rcc executable\n";
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ private:
|
|||||||
std::string DirInfo;
|
std::string DirInfo;
|
||||||
std::string DirBuild;
|
std::string DirBuild;
|
||||||
std::string DirWork;
|
std::string DirWork;
|
||||||
|
std::string DirInclude;
|
||||||
|
std::map<std::string, std::string> DirConfigInclude;
|
||||||
// Sources
|
// Sources
|
||||||
std::vector<std::string> Headers;
|
std::vector<std::string> Headers;
|
||||||
std::vector<std::string> Sources;
|
std::vector<std::string> Sources;
|
||||||
|
|||||||
@@ -1247,14 +1247,11 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// include directory
|
// include directory
|
||||||
{
|
Base_.AutogenIncludeDir = InfoGetConfig("AM_INCLUDE_DIR");
|
||||||
std::string dirRel = InfoGetConfig("AM_INCLUDE_DIR");
|
if (Base_.AutogenIncludeDir.empty()) {
|
||||||
if (dirRel.empty()) {
|
Log().ErrorFile(GeneratorT::GEN, InfoFile(),
|
||||||
Log().ErrorFile(GeneratorT::GEN, InfoFile(),
|
"Autogen include directory missing");
|
||||||
"Autogen include directory missing");
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Base_.AutogenIncludeDir = Base_.AbsoluteBuildPath(dirRel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - Files
|
// - Files
|
||||||
|
|||||||
@@ -141,9 +141,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
|
|||||||
|
|
||||||
// Compute rcc output file name
|
// Compute rcc output file name
|
||||||
if (IsMultiConfig()) {
|
if (IsMultiConfig()) {
|
||||||
RccFileOutput_ = AutogenBuildDir_;
|
RccFileOutput_ = IncludeDir_;
|
||||||
RccFileOutput_ += '/';
|
|
||||||
RccFileOutput_ += IncludeDir_;
|
|
||||||
RccFileOutput_ += '/';
|
RccFileOutput_ += '/';
|
||||||
RccFileOutput_ += MultiConfigOutput();
|
RccFileOutput_ += MultiConfigOutput();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user