summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-09-28 07:21:11 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-09-28 07:21:44 (GMT)
commit7b33d67bc53446e89eb27d750d80e4b639f8d3e5 (patch)
treed60ee74bd90009ff8b37973ddec2d488e6c12e0e
parent786b5be03bf992fe78a9a6450d5665ab7233a815 (diff)
downloadCMake-7b33d67bc53446e89eb27d750d80e4b639f8d3e5.zip
CMake-7b33d67bc53446e89eb27d750d80e4b639f8d3e5.tar.gz
CMake-7b33d67bc53446e89eb27d750d80e4b639f8d3e5.tar.bz2
Autogen: Create info file directory before writing
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 9befd65..bcd5dd2 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -613,6 +613,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
cmGlobalGenerator* globalGen = localGen->GetGlobalGenerator();
std::string const autogenTargetName = GetAutogenTargetName(target);
+ std::string const autogenInfoDir = GetAutogenTargetFilesDir(target);
std::string const autogenBuildDir = GetAutogenTargetBuildDir(target);
std::string const workingDirectory =
cmSystemTools::CollapseFullPath("", makefile->GetCurrentBinaryDirectory());
@@ -630,8 +631,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
AddCleanFile(makefile, autogenBuildDir);
// Remove old settings on cleanup
{
- std::string base = GetAutogenTargetFilesDir(target);
- base += "/AutogenOldSettings";
+ std::string base = autogenInfoDir + "/AutogenOldSettings";
if (multiConfig == cmQtAutoGen::SINGLE) {
AddCleanFile(makefile, base.append(".cmake"));
} else {
@@ -652,7 +652,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
currentLine.push_back(cmSystemTools::GetCMakeCommand());
currentLine.push_back("-E");
currentLine.push_back("cmake_autogen");
- currentLine.push_back(GetAutogenTargetFilesDir(target));
+ currentLine.push_back(autogenInfoDir);
currentLine.push_back("$<CONFIGURATION>");
commandLines.push_back(currentLine);
}
@@ -1088,8 +1088,13 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
// Generate info file
{
- std::string infoFile = GetAutogenTargetFilesDir(target);
- infoFile += "/AutogenInfo.cmake";
+ std::string const infoDir = GetAutogenTargetFilesDir(target);
+ if (!cmSystemTools::MakeDirectory(infoDir)) {
+ std::string emsg = ("Could not create directory: ");
+ emsg += cmQtAutoGen::Quoted(infoDir);
+ cmSystemTools::Error(emsg.c_str());
+ }
+ std::string const infoFile = infoDir + "/AutogenInfo.cmake";
{
std::string infoFileIn = cmSystemTools::GetCMakeRoot();
infoFileIn += "/Modules/AutogenInfo.cmake.in";