diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-09-28 07:21:11 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-09-28 07:21:44 (GMT) |
commit | 7b33d67bc53446e89eb27d750d80e4b639f8d3e5 (patch) | |
tree | d60ee74bd90009ff8b37973ddec2d488e6c12e0e | |
parent | 786b5be03bf992fe78a9a6450d5665ab7233a815 (diff) | |
download | CMake-7b33d67bc53446e89eb27d750d80e4b639f8d3e5.zip CMake-7b33d67bc53446e89eb27d750d80e4b639f8d3e5.tar.gz CMake-7b33d67bc53446e89eb27d750d80e4b639f8d3e5.tar.bz2 |
Autogen: Create info file directory before writing
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 15 |
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"; |