mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 03:29:18 -05:00
Autogen: Revert "AUTO*_EXECUTABLE: add support for per-config values"
Changing the `timestamp` file to `timestamp_$<CONFIG>` causes some user
projects to break when using Qt versions older than 6.6.
Revert commit fddd0f0443 (Autogen: AUTO*_EXECUTABLE: add support for
per-config values, 2023-06-14, v3.28.0-rc1~96^2~1) pending further
investigation.
Issue: #20074
This commit is contained in:
committed by
Brad King
parent
06a9b25b17
commit
c074f5c81e
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <cm/string_view>
|
#include <cm/string_view>
|
||||||
@@ -17,22 +16,6 @@
|
|||||||
class cmQtAutoGen
|
class cmQtAutoGen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** String value with per configuration variants. */
|
|
||||||
class ConfigString
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
std::string Default;
|
|
||||||
std::unordered_map<std::string, std::string> Config;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** String values with per configuration variants. */
|
|
||||||
template <typename C>
|
|
||||||
class ConfigStrings
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
C Default;
|
|
||||||
std::unordered_map<std::string, C> Config;
|
|
||||||
};
|
|
||||||
/** Integer version. */
|
/** Integer version. */
|
||||||
struct IntegerVersion
|
struct IntegerVersion
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -213,81 +213,24 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>
|
cmQtAutoGen::CompilerFeaturesHandle
|
||||||
cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
|
cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
|
||||||
std::string const& generator, cmQtAutoGen::ConfigString const& executable,
|
std::string const& generator, std::string const& executable,
|
||||||
std::string& error, bool const isMultiConfig)
|
std::string& error)
|
||||||
{
|
{
|
||||||
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle> res;
|
|
||||||
if (isMultiConfig) {
|
|
||||||
for (auto const& config : executable.Config) {
|
|
||||||
auto const exe = config.second;
|
|
||||||
// Check if we have cached features
|
|
||||||
{
|
|
||||||
auto it = this->CompilerFeatures_.Config[config.first].find(exe);
|
|
||||||
if (it != this->CompilerFeatures_.Config[config.first].end()) {
|
|
||||||
res.Config[config.first] = it->second;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the executable exists
|
|
||||||
if (!cmSystemTools::FileExists(exe, true)) {
|
|
||||||
error = cmStrCat("The \"", generator, "\" executable ",
|
|
||||||
cmQtAutoGen::Quoted(exe), " does not exist.");
|
|
||||||
res.Config[config.first] = {};
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test the executable
|
|
||||||
std::string stdOut;
|
|
||||||
{
|
|
||||||
std::string stdErr;
|
|
||||||
std::vector<std::string> command;
|
|
||||||
command.emplace_back(exe);
|
|
||||||
command.emplace_back("-h");
|
|
||||||
int retVal = 0;
|
|
||||||
const bool runResult = cmSystemTools::RunSingleCommand(
|
|
||||||
command, &stdOut, &stdErr, &retVal, nullptr,
|
|
||||||
cmSystemTools::OUTPUT_NONE, cmDuration::zero(),
|
|
||||||
cmProcessOutput::Auto);
|
|
||||||
if (!runResult) {
|
|
||||||
error = cmStrCat("Test run of \"", generator, "\" executable ",
|
|
||||||
cmQtAutoGen::Quoted(exe), " failed.\n",
|
|
||||||
cmQtAutoGen::QuotedCommand(command), '\n', stdOut,
|
|
||||||
'\n', stdErr);
|
|
||||||
res.Config[config.first] = {};
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create valid handle
|
|
||||||
res.Config[config.first] =
|
|
||||||
std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
|
||||||
res.Config[config.first]->HelpOutput = std::move(stdOut);
|
|
||||||
|
|
||||||
// Register compiler features
|
|
||||||
this->CompilerFeatures_.Config[config.first].emplace(
|
|
||||||
exe, res.Config[config.first]);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if we have cached features
|
// Check if we have cached features
|
||||||
{
|
{
|
||||||
auto it = this->CompilerFeatures_.Default.find(executable.Default);
|
auto it = this->CompilerFeatures_.find(executable);
|
||||||
if (it != this->CompilerFeatures_.Default.end()) {
|
if (it != this->CompilerFeatures_.end()) {
|
||||||
res.Default = it->second;
|
return it->second;
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the executable exists
|
// Check if the executable exists
|
||||||
if (!cmSystemTools::FileExists(executable.Default, true)) {
|
if (!cmSystemTools::FileExists(executable, true)) {
|
||||||
error =
|
error = cmStrCat("The \"", generator, "\" executable ",
|
||||||
cmStrCat("The \"", generator, "\" executable ",
|
cmQtAutoGen::Quoted(executable), " does not exist.");
|
||||||
cmQtAutoGen::Quoted(executable.Default), " does not exist.");
|
return cmQtAutoGen::CompilerFeaturesHandle();
|
||||||
return cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the executable
|
// Test the executable
|
||||||
@@ -295,7 +238,7 @@ cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
|
|||||||
{
|
{
|
||||||
std::string stdErr;
|
std::string stdErr;
|
||||||
std::vector<std::string> command;
|
std::vector<std::string> command;
|
||||||
command.emplace_back(executable.Default);
|
command.emplace_back(executable);
|
||||||
command.emplace_back("-h");
|
command.emplace_back("-h");
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
const bool runResult = cmSystemTools::RunSingleCommand(
|
const bool runResult = cmSystemTools::RunSingleCommand(
|
||||||
@@ -303,18 +246,20 @@ cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
|
|||||||
cmDuration::zero(), cmProcessOutput::Auto);
|
cmDuration::zero(), cmProcessOutput::Auto);
|
||||||
if (!runResult) {
|
if (!runResult) {
|
||||||
error = cmStrCat("Test run of \"", generator, "\" executable ",
|
error = cmStrCat("Test run of \"", generator, "\" executable ",
|
||||||
cmQtAutoGen::Quoted(executable.Default), " failed.\n",
|
cmQtAutoGen::Quoted(executable), " failed.\n",
|
||||||
cmQtAutoGen::QuotedCommand(command), '\n', stdOut, '\n',
|
cmQtAutoGen::QuotedCommand(command), '\n', stdOut, '\n',
|
||||||
stdErr);
|
stdErr);
|
||||||
return cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>();
|
return cmQtAutoGen::CompilerFeaturesHandle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res.Default = std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
// Create valid handle
|
||||||
res.Default->HelpOutput = std::move(stdOut);
|
cmQtAutoGen::CompilerFeaturesHandle res =
|
||||||
|
std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
||||||
|
res->HelpOutput = std::move(stdOut);
|
||||||
|
|
||||||
// Register compiler features
|
// Register compiler features
|
||||||
this->CompilerFeatures_.Default.emplace(executable.Default, res.Default);
|
this->CompilerFeatures_.emplace(executable, res);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,16 +66,14 @@ private:
|
|||||||
void AddToGlobalAutoRcc(cmLocalGenerator* localGen,
|
void AddToGlobalAutoRcc(cmLocalGenerator* localGen,
|
||||||
std::string const& targetName);
|
std::string const& targetName);
|
||||||
|
|
||||||
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>
|
cmQtAutoGen::CompilerFeaturesHandle GetCompilerFeatures(
|
||||||
GetCompilerFeatures(std::string const& generator,
|
std::string const& generator, std::string const& executable,
|
||||||
cmQtAutoGen::ConfigString const& executable,
|
std::string& error);
|
||||||
std::string& error, bool isMultiConfig);
|
|
||||||
|
|
||||||
std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_;
|
std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_;
|
||||||
std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_;
|
std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_;
|
||||||
std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_;
|
std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_;
|
||||||
cmQtAutoGen::ConfigStrings<
|
std::unordered_map<std::string, cmQtAutoGen::CompilerFeaturesHandle>
|
||||||
std::unordered_map<std::string, cmQtAutoGen::CompilerFeaturesHandle>>
|
|
||||||
CompilerFeatures_;
|
CompilerFeatures_;
|
||||||
Keywords const Keywords_;
|
Keywords const Keywords_;
|
||||||
};
|
};
|
||||||
|
|||||||
+107
-260
@@ -2,7 +2,6 @@
|
|||||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||||
#include "cmQtAutoGenInitializer.h"
|
#include "cmQtAutoGenInitializer.h"
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
@@ -18,7 +17,6 @@
|
|||||||
#include <cm/algorithm>
|
#include <cm/algorithm>
|
||||||
#include <cm/iterator>
|
#include <cm/iterator>
|
||||||
#include <cm/memory>
|
#include <cm/memory>
|
||||||
#include <cm/string_view>
|
|
||||||
#include <cmext/algorithm>
|
#include <cmext/algorithm>
|
||||||
#include <cmext/string_view>
|
#include <cmext/string_view>
|
||||||
|
|
||||||
@@ -303,22 +301,15 @@ bool InfoWriter::Save(std::string const& filename)
|
|||||||
return fileStream.Close();
|
return fileStream.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmQtAutoGen::ConfigStrings<std::vector<std::string>> generateListOptions(
|
void AddAutogenExecutableToDependencies(
|
||||||
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle> const&
|
cmQtAutoGenInitializer::GenVarsT const& genVars,
|
||||||
executableFeatures,
|
std::vector<std::string>& dependencies)
|
||||||
bool IsMultiConfig)
|
|
||||||
{
|
{
|
||||||
cmQtAutoGen::ConfigStrings<std::vector<std::string>> tempListOptions;
|
if (genVars.ExecutableTarget != nullptr) {
|
||||||
if (IsMultiConfig) {
|
dependencies.push_back(genVars.ExecutableTarget->Target->GetName());
|
||||||
for (auto const& executableFeature : executableFeatures.Config) {
|
} else if (!genVars.Executable.empty()) {
|
||||||
tempListOptions.Config[executableFeature.first] =
|
dependencies.push_back(genVars.Executable);
|
||||||
executableFeature.second->ListOptions;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tempListOptions.Default = executableFeatures.Default->ListOptions;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tempListOptions;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of unnamed namespace
|
} // End of unnamed namespace
|
||||||
@@ -345,34 +336,6 @@ cmQtAutoGenInitializer::cmQtAutoGenInitializer(
|
|||||||
!this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty();
|
!this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmQtAutoGenInitializer::AddAutogenExecutableToDependencies(
|
|
||||||
cmQtAutoGenInitializer::GenVarsT const& genVars,
|
|
||||||
std::vector<std::string>& dependencies) const
|
|
||||||
{
|
|
||||||
if (genVars.ExecutableTarget != nullptr) {
|
|
||||||
dependencies.push_back(genVars.ExecutableTarget->Target->GetName());
|
|
||||||
} else if (this->MultiConfig) {
|
|
||||||
cm::string_view const& configGenexWithCommandConfig =
|
|
||||||
"$<COMMAND_CONFIG:$<$<CONFIG:";
|
|
||||||
cm::string_view const& configGenex = "$<$<CONFIG:";
|
|
||||||
cm::string_view const& configGenexEnd = ">";
|
|
||||||
cm::string_view const& configGenexEndWithCommandConfig = ">>";
|
|
||||||
auto genexBegin =
|
|
||||||
this->CrossConfig ? configGenexWithCommandConfig : configGenex;
|
|
||||||
auto genexEnd =
|
|
||||||
this->CrossConfig ? configGenexEndWithCommandConfig : configGenexEnd;
|
|
||||||
for (auto const& config : genVars.Executable.Config) {
|
|
||||||
auto executableWithConfig =
|
|
||||||
cmStrCat(genexBegin, config.first, ">:", config.second, genexEnd);
|
|
||||||
dependencies.emplace_back(std::move(executableWithConfig));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!genVars.Executable.Default.empty()) {
|
|
||||||
dependencies.push_back(genVars.Executable.Default);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cmQtAutoGenInitializer::InitCustomTargets()
|
bool cmQtAutoGenInitializer::InitCustomTargets()
|
||||||
{
|
{
|
||||||
// Configurations
|
// Configurations
|
||||||
@@ -816,30 +779,18 @@ bool cmQtAutoGenInitializer::InitRcc()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Evaluate test output on demand
|
// Evaluate test output on demand
|
||||||
auto& features = this->Rcc.ExecutableFeatures;
|
CompilerFeatures& features = *this->Rcc.ExecutableFeatures;
|
||||||
auto checkAndAddOptions = [this](CompilerFeaturesHandle& feature) {
|
if (!features.Evaluated) {
|
||||||
if (!feature->Evaluated) {
|
// Look for list options
|
||||||
// Look for list options
|
if (this->QtVersion.Major == 5 || this->QtVersion.Major == 6) {
|
||||||
if (this->QtVersion.Major == 5 || this->QtVersion.Major == 6) {
|
if (features.HelpOutput.find("--list") != std::string::npos) {
|
||||||
static std::array<std::string, 2> const listOptions{ { "--list",
|
features.ListOptions.emplace_back("--list");
|
||||||
"-list" } };
|
} else if (features.HelpOutput.find("-list") != std::string::npos) {
|
||||||
for (std::string const& opt : listOptions) {
|
features.ListOptions.emplace_back("-list");
|
||||||
if (feature->HelpOutput.find(opt) != std::string::npos) {
|
|
||||||
feature->ListOptions.emplace_back(opt);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Evaluation finished
|
|
||||||
feature->Evaluated = true;
|
|
||||||
}
|
}
|
||||||
};
|
// Evaluation finished
|
||||||
if (this->MultiConfig) {
|
features.Evaluated = true;
|
||||||
for (auto const& config : this->ConfigsList) {
|
|
||||||
checkAndAddOptions(features.Config[config]);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
checkAndAddOptions(features.Default);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1175,13 +1126,8 @@ bool cmQtAutoGenInitializer::InitScanFiles()
|
|||||||
// Path checksum
|
// Path checksum
|
||||||
qrc.QrcPathChecksum = this->PathCheckSum.getPart(qrc.QrcFile);
|
qrc.QrcPathChecksum = this->PathCheckSum.getPart(qrc.QrcFile);
|
||||||
// Output file name
|
// Output file name
|
||||||
if (this->MultiConfig && !this->GlobalGen->IsXcode()) {
|
qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum,
|
||||||
qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum,
|
"/qrc_", qrc.QrcName, ".cpp");
|
||||||
"_$<CONFIG>", "/qrc_", qrc.QrcName, ".cpp");
|
|
||||||
} else {
|
|
||||||
qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum,
|
|
||||||
"/qrc_", qrc.QrcName, ".cpp");
|
|
||||||
}
|
|
||||||
std::string const base = cmStrCat(this->Dir.Info, "/AutoRcc_",
|
std::string const base = cmStrCat(this->Dir.Info, "/AutoRcc_",
|
||||||
qrc.QrcName, '_', qrc.QrcPathChecksum);
|
qrc.QrcName, '_', qrc.QrcPathChecksum);
|
||||||
qrc.LockFile = cmStrCat(base, "_Lock.lock");
|
qrc.LockFile = cmStrCat(base, "_Lock.lock");
|
||||||
@@ -1213,25 +1159,11 @@ bool cmQtAutoGenInitializer::InitScanFiles()
|
|||||||
for (Qrc& qrc : this->Rcc.Qrcs) {
|
for (Qrc& qrc : this->Rcc.Qrcs) {
|
||||||
if (!qrc.Generated) {
|
if (!qrc.Generated) {
|
||||||
std::string error;
|
std::string error;
|
||||||
if (this->MultiConfig) {
|
RccLister const lister(this->Rcc.Executable,
|
||||||
for (auto const& config : this->ConfigsList) {
|
this->Rcc.ExecutableFeatures->ListOptions);
|
||||||
RccLister const lister(
|
if (!lister.list(qrc.QrcFile, qrc.Resources, error)) {
|
||||||
this->Rcc.Executable.Config[config],
|
cmSystemTools::Error(error);
|
||||||
this->Rcc.ExecutableFeatures.Config[config]->ListOptions);
|
return false;
|
||||||
if (!lister.list(qrc.QrcFile, qrc.Resources.Config[config],
|
|
||||||
error)) {
|
|
||||||
cmSystemTools::Error(error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
RccLister const lister(
|
|
||||||
this->Rcc.Executable.Default,
|
|
||||||
this->Rcc.ExecutableFeatures.Default->ListOptions);
|
|
||||||
if (!lister.list(qrc.QrcFile, qrc.Resources.Default, error)) {
|
|
||||||
cmSystemTools::Error(error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1259,7 +1191,18 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
|
|||||||
if (this->Moc.Enabled) {
|
if (this->Moc.Enabled) {
|
||||||
this->AddGeneratedSource(this->Moc.CompilationFile, this->Moc, true);
|
this->AddGeneratedSource(this->Moc.CompilationFile, this->Moc, true);
|
||||||
if (useDepfile) {
|
if (useDepfile) {
|
||||||
timestampByproducts.push_back(this->Moc.CompilationFileGenex);
|
if (this->MultiConfig && this->CrossConfig &&
|
||||||
|
this->GlobalGen->GetName().find("Ninja") != std::string::npos) {
|
||||||
|
// Make all mocs_compilation_<CONFIG>.cpp files byproducts of the
|
||||||
|
// ${target}_autogen/timestamp custom command.
|
||||||
|
// We cannot just use Moc.CompilationFileGenex here, because that
|
||||||
|
// custom command runs cmake_autogen for each configuration.
|
||||||
|
for (const auto& p : this->Moc.CompilationFile.Config) {
|
||||||
|
timestampByproducts.push_back(p.second);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
timestampByproducts.push_back(this->Moc.CompilationFileGenex);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
autogenByproducts.push_back(this->Moc.CompilationFileGenex);
|
autogenByproducts.push_back(this->Moc.CompilationFileGenex);
|
||||||
}
|
}
|
||||||
@@ -1292,11 +1235,28 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
|
|||||||
// Compose command lines
|
// Compose command lines
|
||||||
// FIXME: Take advantage of our per-config mocs_compilation_$<CONFIG>.cpp
|
// FIXME: Take advantage of our per-config mocs_compilation_$<CONFIG>.cpp
|
||||||
// instead of fiddling with the include directories
|
// instead of fiddling with the include directories
|
||||||
|
std::vector<std::string> configs;
|
||||||
|
this->GlobalGen->GetQtAutoGenConfigs(configs);
|
||||||
bool constexpr stdPipesUTF8 = true;
|
bool constexpr stdPipesUTF8 = true;
|
||||||
cmCustomCommandLines commandLines;
|
cmCustomCommandLines commandLines;
|
||||||
AddCMakeProcessToCommandLines(this->AutogenTarget.InfoFile, "cmake_autogen",
|
if (!this->CrossConfig) {
|
||||||
commandLines);
|
std::string autogenInfoFileConfig;
|
||||||
|
if (this->MultiConfig) {
|
||||||
|
autogenInfoFileConfig = "$<CONFIG>";
|
||||||
|
} else {
|
||||||
|
autogenInfoFileConfig = configs[0];
|
||||||
|
}
|
||||||
|
commandLines.push_back(cmMakeCommandLine(
|
||||||
|
{ cmSystemTools::GetCMakeCommand(), "-E", "cmake_autogen",
|
||||||
|
this->AutogenTarget.InfoFile, autogenInfoFileConfig }));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
for (auto const& config : configs) {
|
||||||
|
commandLines.push_back(cmMakeCommandLine(
|
||||||
|
{ cmSystemTools::GetCMakeCommand(), "-E", "cmake_autogen",
|
||||||
|
this->AutogenTarget.InfoFile, config }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Use PRE_BUILD on demand
|
// Use PRE_BUILD on demand
|
||||||
bool usePRE_BUILD = false;
|
bool usePRE_BUILD = false;
|
||||||
@@ -1464,47 +1424,18 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
|
|||||||
|
|
||||||
AddAutogenExecutableToDependencies(this->Moc, dependencies);
|
AddAutogenExecutableToDependencies(this->Moc, dependencies);
|
||||||
AddAutogenExecutableToDependencies(this->Uic, dependencies);
|
AddAutogenExecutableToDependencies(this->Uic, dependencies);
|
||||||
std::string outputFile;
|
|
||||||
std::string depFile;
|
|
||||||
// Create the custom command that outputs the timestamp file.
|
|
||||||
if (this->MultiConfig) {
|
|
||||||
// create timestamp file with $<CONFIG> in the name so that
|
|
||||||
// every cmake_autogen target has its own timestamp file
|
|
||||||
std::string const configView = "$<CONFIG>";
|
|
||||||
std::string const timestampFileWithoutConfig = "timestamp_";
|
|
||||||
std::string const depFileWithoutConfig =
|
|
||||||
cmStrCat(this->Dir.Build, "/deps_");
|
|
||||||
std::string const timestampFileName =
|
|
||||||
timestampFileWithoutConfig + configView;
|
|
||||||
outputFile = cmStrCat(this->Dir.Build, "/", timestampFileName);
|
|
||||||
auto const depFileWithConfig =
|
|
||||||
cmStrCat(depFileWithoutConfig, configView);
|
|
||||||
depFile = depFileWithConfig;
|
|
||||||
commandLines.push_back(cmMakeCommandLine(
|
|
||||||
{ cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
|
|
||||||
|
|
||||||
ConfigString outputFileWithConfig;
|
// Create the custom command that outputs the timestamp file.
|
||||||
for (std::string const& config : this->ConfigsList) {
|
const char timestampFileName[] = "timestamp";
|
||||||
auto tempTimestampFileName = timestampFileWithoutConfig + config;
|
const std::string outputFile =
|
||||||
auto tempDepFile = depFileWithoutConfig + config;
|
cmStrCat(this->Dir.Build, "/", timestampFileName);
|
||||||
outputFileWithConfig.Config[config] = tempTimestampFileName;
|
this->AutogenTarget.DepFile = cmStrCat(this->Dir.Build, "/deps");
|
||||||
this->AutogenTarget.DepFileRuleName.Config[config] =
|
this->AutogenTarget.DepFileRuleName =
|
||||||
cmStrCat(this->Dir.RelativeBuild, "/", tempTimestampFileName);
|
cmStrCat(this->Dir.RelativeBuild, "/", timestampFileName);
|
||||||
this->AutogenTarget.DepFile.Config[config] = tempDepFile;
|
commandLines.push_back(cmMakeCommandLine(
|
||||||
}
|
{ cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
|
||||||
this->AddGeneratedSource(outputFileWithConfig, this->Moc);
|
|
||||||
} else {
|
this->AddGeneratedSource(outputFile, this->Moc);
|
||||||
cm::string_view const timestampFileName = "timestamp";
|
|
||||||
outputFile = cmStrCat(this->Dir.Build, "/", timestampFileName);
|
|
||||||
this->AutogenTarget.DepFile.Default =
|
|
||||||
cmStrCat(this->Dir.Build, "/deps");
|
|
||||||
depFile = this->AutogenTarget.DepFile.Default;
|
|
||||||
this->AutogenTarget.DepFileRuleName.Default =
|
|
||||||
cmStrCat(this->Dir.RelativeBuild, "/", timestampFileName);
|
|
||||||
commandLines.push_back(cmMakeCommandLine(
|
|
||||||
{ cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
|
|
||||||
this->AddGeneratedSource(outputFile, this->Moc);
|
|
||||||
}
|
|
||||||
cc = cm::make_unique<cmCustomCommand>();
|
cc = cm::make_unique<cmCustomCommand>();
|
||||||
cc->SetOutputs(outputFile);
|
cc->SetOutputs(outputFile);
|
||||||
cc->SetByproducts(timestampByproducts);
|
cc->SetByproducts(timestampByproducts);
|
||||||
@@ -1513,11 +1444,14 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
|
|||||||
cc->SetComment(autogenComment.c_str());
|
cc->SetComment(autogenComment.c_str());
|
||||||
cc->SetWorkingDirectory(this->Dir.Work.c_str());
|
cc->SetWorkingDirectory(this->Dir.Work.c_str());
|
||||||
cc->SetEscapeOldStyle(false);
|
cc->SetEscapeOldStyle(false);
|
||||||
cc->SetDepfile(depFile);
|
cc->SetDepfile(this->AutogenTarget.DepFile);
|
||||||
cc->SetStdPipesUTF8(stdPipesUTF8);
|
cc->SetStdPipesUTF8(stdPipesUTF8);
|
||||||
this->LocalGen->AddCustomCommandToOutput(std::move(cc));
|
this->LocalGen->AddCustomCommandToOutput(std::move(cc));
|
||||||
|
|
||||||
|
// Alter variables for the autogen target which now merely wraps the
|
||||||
|
// custom command
|
||||||
dependencies.clear();
|
dependencies.clear();
|
||||||
dependencies.emplace_back(std::move(outputFile));
|
dependencies.emplace_back(outputFile);
|
||||||
commandLines.clear();
|
commandLines.clear();
|
||||||
autogenComment.clear();
|
autogenComment.clear();
|
||||||
}
|
}
|
||||||
@@ -1569,35 +1503,6 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmQtAutoGenInitializer::AddCMakeProcessToCommandLines(
|
|
||||||
std::string const& infoFile, std::string const& processName,
|
|
||||||
cmCustomCommandLines& commandLines)
|
|
||||||
{
|
|
||||||
if (this->CrossConfig) {
|
|
||||||
commandLines.push_back(cmMakeCommandLine(
|
|
||||||
{ cmSystemTools::GetCMakeCommand(), "-E", processName, infoFile,
|
|
||||||
"$<CONFIG>", "$<COMMAND_CONFIG:$<CONFIG>>" }));
|
|
||||||
} else if (this->MultiConfig && this->GlobalGen->IsXcode()) {
|
|
||||||
for (std::string const& config : this->ConfigsList) {
|
|
||||||
commandLines.push_back(
|
|
||||||
cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E",
|
|
||||||
processName, infoFile, config }));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
std::string autoInfoFileConfig;
|
|
||||||
if (this->MultiConfig) {
|
|
||||||
autoInfoFileConfig = "$<CONFIG>";
|
|
||||||
} else {
|
|
||||||
std::vector<std::string> configs;
|
|
||||||
this->GlobalGen->GetQtAutoGenConfigs(configs);
|
|
||||||
autoInfoFileConfig = configs[0];
|
|
||||||
}
|
|
||||||
commandLines.push_back(
|
|
||||||
cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E", processName,
|
|
||||||
infoFile, autoInfoFileConfig }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cmQtAutoGenInitializer::InitRccTargets()
|
bool cmQtAutoGenInitializer::InitRccTargets()
|
||||||
{
|
{
|
||||||
for (Qrc const& qrc : this->Rcc.Qrcs) {
|
for (Qrc const& qrc : this->Rcc.Qrcs) {
|
||||||
@@ -1618,7 +1523,18 @@ bool cmQtAutoGenInitializer::InitRccTargets()
|
|||||||
ccDepends.push_back(qrc.InfoFile);
|
ccDepends.push_back(qrc.InfoFile);
|
||||||
|
|
||||||
cmCustomCommandLines commandLines;
|
cmCustomCommandLines commandLines;
|
||||||
AddCMakeProcessToCommandLines(qrc.InfoFile, "cmake_autorcc", commandLines);
|
if (this->MultiConfig) {
|
||||||
|
// Build for all configurations
|
||||||
|
for (std::string const& config : this->ConfigsList) {
|
||||||
|
commandLines.push_back(
|
||||||
|
cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E",
|
||||||
|
"cmake_autorcc", qrc.InfoFile, config }));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
commandLines.push_back(
|
||||||
|
cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E",
|
||||||
|
"cmake_autorcc", qrc.InfoFile, "$<CONFIG>" }));
|
||||||
|
}
|
||||||
|
|
||||||
std::string const ccComment =
|
std::string const ccComment =
|
||||||
cmStrCat("Automatic RCC for ",
|
cmStrCat("Automatic RCC for ",
|
||||||
@@ -1669,28 +1585,13 @@ bool cmQtAutoGenInitializer::InitRccTargets()
|
|||||||
// Create custom rcc command
|
// Create custom rcc command
|
||||||
{
|
{
|
||||||
// Add the resource files to the dependencies
|
// Add the resource files to the dependencies
|
||||||
if (this->MultiConfig) {
|
for (std::string const& fileName : qrc.Resources) {
|
||||||
for (auto const& config : this->ConfigsList) {
|
// Add resource file to the custom command dependencies
|
||||||
// Add resource file to the custom command dependencies
|
ccDepends.push_back(fileName);
|
||||||
auto resourceFilesWithConfig = cmStrCat(
|
|
||||||
"$<$<CONFIG:", config,
|
|
||||||
">:", cmList{ qrc.Resources.Config.at(config) }.to_string(),
|
|
||||||
">");
|
|
||||||
ccDepends.emplace_back(std::move(resourceFilesWithConfig));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (std::string const& fileName : qrc.Resources.Default) {
|
|
||||||
// Add resource file to the custom command dependencies
|
|
||||||
ccDepends.push_back(fileName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this->Rcc.ExecutableTargetName.empty()) {
|
if (!this->Rcc.ExecutableTargetName.empty()) {
|
||||||
ccDepends.push_back(this->Rcc.ExecutableTargetName);
|
ccDepends.push_back(this->Rcc.ExecutableTargetName);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddAutogenExecutableToDependencies(this->Rcc, ccDepends);
|
|
||||||
|
|
||||||
cc->SetOutputs(ccOutput);
|
cc->SetOutputs(ccOutput);
|
||||||
cc->SetDepends(ccDepends);
|
cc->SetDepends(ccDepends);
|
||||||
this->LocalGen->AddCustomCommandToOutput(std::move(cc));
|
this->LocalGen->AddCustomCommandToOutput(std::move(cc));
|
||||||
@@ -1790,7 +1691,6 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
|
|||||||
|
|
||||||
// General
|
// General
|
||||||
info.SetBool("MULTI_CONFIG", this->MultiConfig);
|
info.SetBool("MULTI_CONFIG", this->MultiConfig);
|
||||||
info.SetBool("CROSS_CONFIG", this->CrossConfig);
|
|
||||||
info.SetUInt("PARALLEL", this->AutogenTarget.Parallel);
|
info.SetUInt("PARALLEL", this->AutogenTarget.Parallel);
|
||||||
info.SetUInt("VERBOSITY", this->Verbosity);
|
info.SetUInt("VERBOSITY", this->Verbosity);
|
||||||
|
|
||||||
@@ -1804,14 +1704,14 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
|
|||||||
|
|
||||||
info.SetUInt("QT_VERSION_MAJOR", this->QtVersion.Major);
|
info.SetUInt("QT_VERSION_MAJOR", this->QtVersion.Major);
|
||||||
info.SetUInt("QT_VERSION_MINOR", this->QtVersion.Minor);
|
info.SetUInt("QT_VERSION_MINOR", this->QtVersion.Minor);
|
||||||
info.SetConfig("QT_MOC_EXECUTABLE", this->Moc.Executable);
|
info.Set("QT_MOC_EXECUTABLE", this->Moc.Executable);
|
||||||
info.SetConfig("QT_UIC_EXECUTABLE", this->Uic.Executable);
|
info.Set("QT_UIC_EXECUTABLE", this->Uic.Executable);
|
||||||
|
|
||||||
info.Set("CMAKE_EXECUTABLE", cmSystemTools::GetCMakeCommand());
|
info.Set("CMAKE_EXECUTABLE", cmSystemTools::GetCMakeCommand());
|
||||||
info.SetConfig("SETTINGS_FILE", this->AutogenTarget.SettingsFile);
|
info.SetConfig("SETTINGS_FILE", this->AutogenTarget.SettingsFile);
|
||||||
info.SetConfig("PARSE_CACHE_FILE", this->AutogenTarget.ParseCacheFile);
|
info.SetConfig("PARSE_CACHE_FILE", this->AutogenTarget.ParseCacheFile);
|
||||||
info.SetConfig("DEP_FILE", this->AutogenTarget.DepFile);
|
info.Set("DEP_FILE", this->AutogenTarget.DepFile);
|
||||||
info.SetConfig("DEP_FILE_RULE_NAME", this->AutogenTarget.DepFileRuleName);
|
info.Set("DEP_FILE_RULE_NAME", this->AutogenTarget.DepFileRuleName);
|
||||||
info.SetArray("CMAKE_LIST_FILES", this->Makefile->GetListFiles());
|
info.SetArray("CMAKE_LIST_FILES", this->Makefile->GetListFiles());
|
||||||
info.SetArray("HEADER_EXTENSIONS",
|
info.SetArray("HEADER_EXTENSIONS",
|
||||||
this->Makefile->GetCMakeInstance()->GetHeaderExtensions());
|
this->Makefile->GetCMakeInstance()->GetHeaderExtensions());
|
||||||
@@ -1938,7 +1838,6 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
|
|||||||
|
|
||||||
// General
|
// General
|
||||||
info.SetBool("MULTI_CONFIG", this->MultiConfig);
|
info.SetBool("MULTI_CONFIG", this->MultiConfig);
|
||||||
info.SetBool("CROSS_CONFIG", this->CrossConfig);
|
|
||||||
info.SetUInt("VERBOSITY", this->Verbosity);
|
info.SetUInt("VERBOSITY", this->Verbosity);
|
||||||
info.Set("GENERATOR", this->GlobalGen->GetName());
|
info.Set("GENERATOR", this->GlobalGen->GetName());
|
||||||
|
|
||||||
@@ -1955,17 +1854,16 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
|
|||||||
info.SetConfig("INCLUDE_DIR", this->Dir.Include);
|
info.SetConfig("INCLUDE_DIR", this->Dir.Include);
|
||||||
|
|
||||||
// rcc executable
|
// rcc executable
|
||||||
info.SetConfig("RCC_EXECUTABLE", this->Rcc.Executable);
|
info.Set("RCC_EXECUTABLE", this->Rcc.Executable);
|
||||||
info.SetConfigArray(
|
info.SetArray("RCC_LIST_OPTIONS",
|
||||||
"RCC_LIST_OPTIONS",
|
this->Rcc.ExecutableFeatures->ListOptions);
|
||||||
generateListOptions(this->Rcc.ExecutableFeatures, this->MultiConfig));
|
|
||||||
|
|
||||||
// qrc file
|
// qrc file
|
||||||
info.Set("SOURCE", qrc.QrcFile);
|
info.Set("SOURCE", qrc.QrcFile);
|
||||||
info.Set("OUTPUT_CHECKSUM", qrc.QrcPathChecksum);
|
info.Set("OUTPUT_CHECKSUM", qrc.QrcPathChecksum);
|
||||||
info.Set("OUTPUT_NAME", cmSystemTools::GetFilenameName(qrc.OutputFile));
|
info.Set("OUTPUT_NAME", cmSystemTools::GetFilenameName(qrc.OutputFile));
|
||||||
info.SetArray("OPTIONS", qrc.Options);
|
info.SetArray("OPTIONS", qrc.Options);
|
||||||
info.SetConfigArray("INPUTS", qrc.Resources);
|
info.SetArray("INPUTS", qrc.Resources);
|
||||||
|
|
||||||
info.Save(qrc.InfoFile);
|
info.Save(qrc.InfoFile);
|
||||||
}
|
}
|
||||||
@@ -2309,32 +2207,16 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
|
|||||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||||
cmGeneratorExpression ge(*this->Makefile->GetCMakeInstance(), lfbt);
|
cmGeneratorExpression ge(*this->Makefile->GetCMakeInstance(), lfbt);
|
||||||
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(val);
|
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(val);
|
||||||
if (this->MultiConfig) {
|
genVars.Executable = cge->Evaluate(this->LocalGen, "");
|
||||||
for (auto const& config : this->ConfigsList) {
|
|
||||||
genVars.Executable.Config[config] =
|
|
||||||
cge->Evaluate(this->LocalGen, config);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
genVars.Executable.Default = cge->Evaluate(this->LocalGen, "");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (genVars.Executable.empty() && !ignoreMissingTarget) {
|
||||||
if (genVars.Executable.Default.empty() &&
|
|
||||||
genVars.Executable.Config.empty() && !ignoreMissingTarget) {
|
|
||||||
print_err(prop + " evaluates to an empty value");
|
print_err(prop + " evaluates to an empty value");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create empty compiler features.
|
// Create empty compiler features.
|
||||||
if (this->MultiConfig) {
|
genVars.ExecutableFeatures =
|
||||||
for (auto const& config : this->ConfigsList) {
|
std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
||||||
genVars.ExecutableFeatures.Config[config] =
|
|
||||||
std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
genVars.ExecutableFeatures.Default =
|
|
||||||
std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2359,39 +2241,15 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
|
|||||||
genVars.ExecutableTargetName = targetName;
|
genVars.ExecutableTargetName = targetName;
|
||||||
genVars.ExecutableTarget = genTarget;
|
genVars.ExecutableTarget = genTarget;
|
||||||
if (genTarget->IsImported()) {
|
if (genTarget->IsImported()) {
|
||||||
if (this->MultiConfig) {
|
genVars.Executable = genTarget->ImportedGetLocation("");
|
||||||
for (auto const& config : this->ConfigsList) {
|
|
||||||
genVars.Executable.Config[config] =
|
|
||||||
genTarget->ImportedGetLocation(config);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
genVars.Executable.Default =
|
|
||||||
genTarget->ImportedGetLocation(this->ConfigDefault);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (this->MultiConfig) {
|
genVars.Executable = genTarget->GetLocation("");
|
||||||
for (auto const& config : this->ConfigsList) {
|
|
||||||
genVars.Executable.Config[config] = genTarget->GetLocation(config);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
genVars.Executable.Default =
|
|
||||||
genTarget->GetLocation(this->ConfigDefault);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ignoreMissingTarget) {
|
if (ignoreMissingTarget) {
|
||||||
// Create empty compiler features.
|
// Create empty compiler features.
|
||||||
if (this->MultiConfig) {
|
genVars.ExecutableFeatures =
|
||||||
for (auto const& config : this->ConfigsList) {
|
std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
||||||
genVars.ExecutableFeatures.Config[config] =
|
|
||||||
std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
genVars.ExecutableFeatures.Default =
|
|
||||||
std::make_shared<cmQtAutoGen::CompilerFeatures>();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
print_err(cmStrCat("Could not find ", executable, " executable target ",
|
print_err(cmStrCat("Could not find ", executable, " executable target ",
|
||||||
@@ -2404,21 +2262,10 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
|
|||||||
{
|
{
|
||||||
std::string err;
|
std::string err;
|
||||||
genVars.ExecutableFeatures = this->GlobalInitializer->GetCompilerFeatures(
|
genVars.ExecutableFeatures = this->GlobalInitializer->GetCompilerFeatures(
|
||||||
executable, genVars.Executable, err, this->MultiConfig);
|
executable, genVars.Executable, err);
|
||||||
if (this->MultiConfig) {
|
if (!genVars.ExecutableFeatures) {
|
||||||
for (auto const& config : this->ConfigsList) {
|
print_err(err);
|
||||||
if (!genVars.ExecutableFeatures.Config[config]) {
|
return false;
|
||||||
if (!genVars.ExecutableFeatures.Config[config]) {
|
|
||||||
print_err(err);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!genVars.ExecutableFeatures.Default) {
|
|
||||||
print_err(err);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include "cmFilePathChecksum.h"
|
#include "cmFilePathChecksum.h"
|
||||||
#include "cmQtAutoGen.h"
|
#include "cmQtAutoGen.h"
|
||||||
|
|
||||||
class cmCustomCommandLines;
|
|
||||||
class cmGeneratorTarget;
|
class cmGeneratorTarget;
|
||||||
class cmGlobalGenerator;
|
class cmGlobalGenerator;
|
||||||
class cmLocalGenerator;
|
class cmLocalGenerator;
|
||||||
@@ -33,6 +32,23 @@ class cmTarget;
|
|||||||
class cmQtAutoGenInitializer : public cmQtAutoGen
|
class cmQtAutoGenInitializer : public cmQtAutoGen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/** String value with per configuration variants. */
|
||||||
|
class ConfigString
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::string Default;
|
||||||
|
std::unordered_map<std::string, std::string> Config;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** String values with per configuration variants. */
|
||||||
|
template <typename C>
|
||||||
|
class ConfigStrings
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
C Default;
|
||||||
|
std::unordered_map<std::string, C> Config;
|
||||||
|
};
|
||||||
|
|
||||||
/** rcc job. */
|
/** rcc job. */
|
||||||
class Qrc
|
class Qrc
|
||||||
{
|
{
|
||||||
@@ -47,7 +63,7 @@ public:
|
|||||||
bool Generated = false;
|
bool Generated = false;
|
||||||
bool Unique = false;
|
bool Unique = false;
|
||||||
std::vector<std::string> Options;
|
std::vector<std::string> Options;
|
||||||
ConfigStrings<std::vector<std::string>> Resources;
|
std::vector<std::string> Resources;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** moc and/or uic file. */
|
/** moc and/or uic file. */
|
||||||
@@ -74,8 +90,8 @@ public:
|
|||||||
// Executable
|
// Executable
|
||||||
std::string ExecutableTargetName;
|
std::string ExecutableTargetName;
|
||||||
cmGeneratorTarget* ExecutableTarget = nullptr;
|
cmGeneratorTarget* ExecutableTarget = nullptr;
|
||||||
ConfigString Executable;
|
std::string Executable;
|
||||||
ConfigStrings<CompilerFeaturesHandle> ExecutableFeatures;
|
CompilerFeaturesHandle ExecutableFeatures;
|
||||||
|
|
||||||
GenVarsT(GenT gen)
|
GenVarsT(GenT gen)
|
||||||
: Gen(gen)
|
: Gen(gen)
|
||||||
@@ -125,9 +141,6 @@ private:
|
|||||||
GenVarsT const& genVars, bool prepend = false);
|
GenVarsT const& genVars, bool prepend = false);
|
||||||
void AddToSourceGroup(std::string const& fileName,
|
void AddToSourceGroup(std::string const& fileName,
|
||||||
cm::string_view genNameUpper);
|
cm::string_view genNameUpper);
|
||||||
void AddCMakeProcessToCommandLines(std::string const& infoFile,
|
|
||||||
std::string const& processName,
|
|
||||||
cmCustomCommandLines& commandLines);
|
|
||||||
void AddCleanFile(std::string const& fileName);
|
void AddCleanFile(std::string const& fileName);
|
||||||
|
|
||||||
void ConfigFileNames(ConfigString& configString, cm::string_view prefix,
|
void ConfigFileNames(ConfigString& configString, cm::string_view prefix,
|
||||||
@@ -142,9 +155,6 @@ private:
|
|||||||
bool ignoreMissingTarget) const;
|
bool ignoreMissingTarget) const;
|
||||||
|
|
||||||
void handleSkipPch(cmSourceFile* sf);
|
void handleSkipPch(cmSourceFile* sf);
|
||||||
void AddAutogenExecutableToDependencies(
|
|
||||||
cmQtAutoGenInitializer::GenVarsT const& genVars,
|
|
||||||
std::vector<std::string>& dependencies) const;
|
|
||||||
|
|
||||||
cmQtAutoGenGlobalInitializer* GlobalInitializer = nullptr;
|
cmQtAutoGenGlobalInitializer* GlobalInitializer = nullptr;
|
||||||
cmGeneratorTarget* GenTarget = nullptr;
|
cmGeneratorTarget* GenTarget = nullptr;
|
||||||
@@ -192,8 +202,8 @@ private:
|
|||||||
bool DependOrigin = false;
|
bool DependOrigin = false;
|
||||||
std::set<std::string> DependFiles;
|
std::set<std::string> DependFiles;
|
||||||
std::set<cmTarget*> DependTargets;
|
std::set<cmTarget*> DependTargets;
|
||||||
ConfigString DepFile;
|
std::string DepFile;
|
||||||
ConfigString DepFileRuleName;
|
std::string DepFileRuleName;
|
||||||
// Sources to process
|
// Sources to process
|
||||||
std::unordered_map<cmSourceFile*, MUFileHandle> Headers;
|
std::unordered_map<cmSourceFile*, MUFileHandle> Headers;
|
||||||
std::unordered_map<cmSourceFile*, MUFileHandle> Sources;
|
std::unordered_map<cmSourceFile*, MUFileHandle> Sources;
|
||||||
|
|||||||
@@ -430,12 +430,10 @@ std::string cmQtAutoGenerator::MessagePath(cm::string_view path) const
|
|||||||
return cmQtAutoGen::Quoted(res);
|
return cmQtAutoGen::Quoted(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmQtAutoGenerator::Run(cm::string_view infoFile, cm::string_view config,
|
bool cmQtAutoGenerator::Run(cm::string_view infoFile, cm::string_view config)
|
||||||
cm::string_view executableConfig)
|
|
||||||
{
|
{
|
||||||
// Info config
|
// Info config
|
||||||
this->InfoConfig_ = std::string(config);
|
this->InfoConfig_ = std::string(config);
|
||||||
this->ExecutableConfig_ = std::string(executableConfig);
|
|
||||||
|
|
||||||
// Info file
|
// Info file
|
||||||
this->InfoFile_ = std::string(infoFile);
|
this->InfoFile_ = std::string(infoFile);
|
||||||
|
|||||||
@@ -90,10 +90,6 @@ public:
|
|||||||
std::string const& InfoDir() const { return this->InfoDir_; }
|
std::string const& InfoDir() const { return this->InfoDir_; }
|
||||||
cmFileTime const& InfoFileTime() const { return this->InfoFileTime_; }
|
cmFileTime const& InfoFileTime() const { return this->InfoFileTime_; }
|
||||||
std::string const& InfoConfig() const { return this->InfoConfig_; }
|
std::string const& InfoConfig() const { return this->InfoConfig_; }
|
||||||
std::string const& ExecutableConfig() const
|
|
||||||
{
|
|
||||||
return this->ExecutableConfig_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- Info file parsing
|
// -- Info file parsing
|
||||||
/** Info file reader class. */
|
/** Info file reader class. */
|
||||||
@@ -155,8 +151,7 @@ public:
|
|||||||
std::string MessagePath(cm::string_view path) const;
|
std::string MessagePath(cm::string_view path) const;
|
||||||
|
|
||||||
// -- Run
|
// -- Run
|
||||||
bool Run(cm::string_view infoFile, cm::string_view config,
|
bool Run(cm::string_view infoFile, cm::string_view config);
|
||||||
cm::string_view executableConfig);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// -- Abstract processing interface
|
// -- Abstract processing interface
|
||||||
@@ -175,7 +170,6 @@ private:
|
|||||||
std::string InfoDir_;
|
std::string InfoDir_;
|
||||||
cmFileTime InfoFileTime_;
|
cmFileTime InfoFileTime_;
|
||||||
std::string InfoConfig_;
|
std::string InfoConfig_;
|
||||||
std::string ExecutableConfig_;
|
|
||||||
// -- Directories
|
// -- Directories
|
||||||
ProjectDirsT ProjectDirs_;
|
ProjectDirsT ProjectDirs_;
|
||||||
};
|
};
|
||||||
|
|||||||
+10
-28
@@ -170,7 +170,6 @@ public:
|
|||||||
// -- Attributes
|
// -- Attributes
|
||||||
// - Config
|
// - Config
|
||||||
bool MultiConfig = false;
|
bool MultiConfig = false;
|
||||||
bool CrossConfig = false;
|
|
||||||
IntegerVersion QtVersion = { 4, 0 };
|
IntegerVersion QtVersion = { 4, 0 };
|
||||||
unsigned int ThreadCount = 0;
|
unsigned int ThreadCount = 0;
|
||||||
// - Directories
|
// - Directories
|
||||||
@@ -2373,7 +2372,6 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
|||||||
{
|
{
|
||||||
// -- Required settings
|
// -- Required settings
|
||||||
if (!info.GetBool("MULTI_CONFIG", this->BaseConst_.MultiConfig, true) ||
|
if (!info.GetBool("MULTI_CONFIG", this->BaseConst_.MultiConfig, true) ||
|
||||||
!info.GetBool("CROSS_CONFIG", this->BaseConst_.CrossConfig, true) ||
|
|
||||||
!info.GetUInt("QT_VERSION_MAJOR", this->BaseConst_.QtVersion.Major,
|
!info.GetUInt("QT_VERSION_MAJOR", this->BaseConst_.QtVersion.Major,
|
||||||
true) ||
|
true) ||
|
||||||
!info.GetUInt("QT_VERSION_MINOR", this->BaseConst_.QtVersion.Minor,
|
!info.GetUInt("QT_VERSION_MINOR", this->BaseConst_.QtVersion.Minor,
|
||||||
@@ -2386,34 +2384,19 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
|||||||
true) ||
|
true) ||
|
||||||
!info.GetStringConfig("PARSE_CACHE_FILE",
|
!info.GetStringConfig("PARSE_CACHE_FILE",
|
||||||
this->BaseConst_.ParseCacheFile, true) ||
|
this->BaseConst_.ParseCacheFile, true) ||
|
||||||
!info.GetStringConfig("DEP_FILE", this->BaseConst_.DepFile, false) ||
|
!info.GetString("DEP_FILE", this->BaseConst_.DepFile, false) ||
|
||||||
!info.GetStringConfig("DEP_FILE_RULE_NAME",
|
!info.GetString("DEP_FILE_RULE_NAME", this->BaseConst_.DepFileRuleName,
|
||||||
this->BaseConst_.DepFileRuleName, false) ||
|
false) ||
|
||||||
!info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) ||
|
!info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) ||
|
||||||
!info.GetArray("CMAKE_LIST_FILES", this->BaseConst_.ListFiles, true) ||
|
!info.GetArray("CMAKE_LIST_FILES", this->BaseConst_.ListFiles, true) ||
|
||||||
!info.GetArray("HEADER_EXTENSIONS", this->BaseConst_.HeaderExtensions,
|
!info.GetArray("HEADER_EXTENSIONS", this->BaseConst_.HeaderExtensions,
|
||||||
true)) {
|
true) ||
|
||||||
|
!info.GetString("QT_MOC_EXECUTABLE", this->MocConst_.Executable,
|
||||||
|
false) ||
|
||||||
|
!info.GetString("QT_UIC_EXECUTABLE", this->UicConst_.Executable,
|
||||||
|
false)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this->BaseConst_.CrossConfig) {
|
|
||||||
std::string const mocExecutableWithConfig =
|
|
||||||
"QT_MOC_EXECUTABLE_" + this->ExecutableConfig();
|
|
||||||
std::string const uicExecutableWithConfig =
|
|
||||||
"QT_UIC_EXECUTABLE_" + this->ExecutableConfig();
|
|
||||||
if (!info.GetString(mocExecutableWithConfig, this->MocConst_.Executable,
|
|
||||||
false) ||
|
|
||||||
!info.GetString(uicExecutableWithConfig, this->UicConst_.Executable,
|
|
||||||
false)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!info.GetStringConfig("QT_MOC_EXECUTABLE", this->MocConst_.Executable,
|
|
||||||
false) ||
|
|
||||||
!info.GetStringConfig("QT_UIC_EXECUTABLE", this->UicConst_.Executable,
|
|
||||||
false)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- Checks
|
// -- Checks
|
||||||
if (!this->BaseConst_.CMakeExecutableTime.Load(
|
if (!this->BaseConst_.CMakeExecutableTime.Load(
|
||||||
@@ -3080,8 +3063,7 @@ std::string cmQtAutoMocUicT::AbsoluteIncludePath(
|
|||||||
|
|
||||||
} // End of unnamed namespace
|
} // End of unnamed namespace
|
||||||
|
|
||||||
bool cmQtAutoMocUic(cm::string_view infoFile, cm::string_view config,
|
bool cmQtAutoMocUic(cm::string_view infoFile, cm::string_view config)
|
||||||
cm::string_view executableConfig)
|
|
||||||
{
|
{
|
||||||
return cmQtAutoMocUicT().Run(infoFile, config, executableConfig);
|
return cmQtAutoMocUicT().Run(infoFile, config);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,5 +10,4 @@
|
|||||||
* Process AUTOMOC and AUTOUIC
|
* Process AUTOMOC and AUTOUIC
|
||||||
* @return true on success
|
* @return true on success
|
||||||
*/
|
*/
|
||||||
bool cmQtAutoMocUic(cm::string_view infoFile, cm::string_view config,
|
bool cmQtAutoMocUic(cm::string_view infoFile, cm::string_view config);
|
||||||
cm::string_view executableConfig);
|
|
||||||
|
|||||||
+8
-35
@@ -35,11 +35,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
// -- Utility
|
// -- Utility
|
||||||
bool IsMultiConfig() const { return this->MultiConfig_; }
|
bool IsMultiConfig() const { return this->MultiConfig_; }
|
||||||
std::string const& GetGenerator() const { return this->Generator_; }
|
|
||||||
bool IsXcode() const
|
|
||||||
{
|
|
||||||
return this->GetGenerator().find("Xcode") != std::string::npos;
|
|
||||||
}
|
|
||||||
std::string MultiConfigOutput() const;
|
std::string MultiConfigOutput() const;
|
||||||
|
|
||||||
// -- Abstract processing interface
|
// -- Abstract processing interface
|
||||||
@@ -58,8 +53,6 @@ private:
|
|||||||
|
|
||||||
// -- Config settings
|
// -- Config settings
|
||||||
bool MultiConfig_ = false;
|
bool MultiConfig_ = false;
|
||||||
bool CrossConfig_ = false;
|
|
||||||
std::string Generator_;
|
|
||||||
// -- Directories
|
// -- Directories
|
||||||
std::string AutogenBuildDir_;
|
std::string AutogenBuildDir_;
|
||||||
std::string IncludeDir_;
|
std::string IncludeDir_;
|
||||||
@@ -99,45 +92,26 @@ bool cmQtAutoRccT::InitFromInfo(InfoT const& info)
|
|||||||
{
|
{
|
||||||
// -- Required settings
|
// -- Required settings
|
||||||
if (!info.GetBool("MULTI_CONFIG", this->MultiConfig_, true) ||
|
if (!info.GetBool("MULTI_CONFIG", this->MultiConfig_, true) ||
|
||||||
!info.GetString("GENERATOR", this->Generator_, true) ||
|
|
||||||
!info.GetBool("CROSS_CONFIG", this->CrossConfig_, true) ||
|
|
||||||
!info.GetString("BUILD_DIR", this->AutogenBuildDir_, true) ||
|
!info.GetString("BUILD_DIR", this->AutogenBuildDir_, true) ||
|
||||||
!info.GetStringConfig("INCLUDE_DIR", this->IncludeDir_, true) ||
|
!info.GetStringConfig("INCLUDE_DIR", this->IncludeDir_, true) ||
|
||||||
!info.GetArrayConfig("RCC_LIST_OPTIONS", this->RccListOptions_, false) ||
|
!info.GetString("RCC_EXECUTABLE", this->RccExecutable_, true) ||
|
||||||
|
!info.GetArray("RCC_LIST_OPTIONS", this->RccListOptions_, false) ||
|
||||||
!info.GetString("LOCK_FILE", this->LockFile_, true) ||
|
!info.GetString("LOCK_FILE", this->LockFile_, true) ||
|
||||||
!info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) ||
|
!info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) ||
|
||||||
!info.GetString("SOURCE", this->QrcFile_, true) ||
|
!info.GetString("SOURCE", this->QrcFile_, true) ||
|
||||||
!info.GetString("OUTPUT_CHECKSUM", this->RccPathChecksum_, true) ||
|
!info.GetString("OUTPUT_CHECKSUM", this->RccPathChecksum_, true) ||
|
||||||
!info.GetString("OUTPUT_NAME", this->RccFileName_, true) ||
|
!info.GetString("OUTPUT_NAME", this->RccFileName_, true) ||
|
||||||
!info.GetArray("OPTIONS", this->Options_, false) ||
|
!info.GetArray("OPTIONS", this->Options_, false) ||
|
||||||
!info.GetArrayConfig("INPUTS", this->Inputs_, false)) {
|
!info.GetArray("INPUTS", this->Inputs_, false)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->CrossConfig_) {
|
|
||||||
std::string const rccExecutableWithConfig =
|
|
||||||
"RCC_EXECUTABLE_" + this->ExecutableConfig();
|
|
||||||
if (!info.GetString(rccExecutableWithConfig, this->RccExecutable_, true)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!info.GetStringConfig("RCC_EXECUTABLE", this->RccExecutable_, true)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- Derive information
|
// -- Derive information
|
||||||
this->QrcFileName_ = cmSystemTools::GetFilenameName(this->QrcFile_);
|
this->QrcFileName_ = cmSystemTools::GetFilenameName(this->QrcFile_);
|
||||||
this->QrcFileDir_ = cmSystemTools::GetFilenamePath(this->QrcFile_);
|
this->QrcFileDir_ = cmSystemTools::GetFilenamePath(this->QrcFile_);
|
||||||
if (IsMultiConfig() && !this->IsXcode()) {
|
this->RccFilePublic_ =
|
||||||
this->RccFilePublic_ =
|
cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, '/',
|
||||||
cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, "_",
|
this->RccFileName_);
|
||||||
this->InfoConfig(), '/', this->RccFileName_);
|
|
||||||
} else {
|
|
||||||
this->RccFilePublic_ =
|
|
||||||
cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, '/',
|
|
||||||
this->RccFileName_);
|
|
||||||
}
|
|
||||||
|
|
||||||
// rcc output file name
|
// rcc output file name
|
||||||
if (this->IsMultiConfig()) {
|
if (this->IsMultiConfig()) {
|
||||||
@@ -546,8 +520,7 @@ bool cmQtAutoRccT::GenerateWrapper()
|
|||||||
|
|
||||||
} // End of unnamed namespace
|
} // End of unnamed namespace
|
||||||
|
|
||||||
bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config,
|
bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config)
|
||||||
cm::string_view executableConfig)
|
|
||||||
{
|
{
|
||||||
return cmQtAutoRccT().Run(infoFile, config, executableConfig);
|
return cmQtAutoRccT().Run(infoFile, config);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,5 +10,4 @@
|
|||||||
* Process AUTORCC
|
* Process AUTORCC
|
||||||
* @return true on success
|
* @return true on success
|
||||||
*/
|
*/
|
||||||
bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config,
|
bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config);
|
||||||
cm::string_view executableConfig);
|
|
||||||
|
|||||||
+2
-6
@@ -1433,17 +1433,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
|
|||||||
if ((args[1] == "cmake_autogen") && (args.size() >= 4)) {
|
if ((args[1] == "cmake_autogen") && (args.size() >= 4)) {
|
||||||
cm::string_view const infoFile = args[2];
|
cm::string_view const infoFile = args[2];
|
||||||
cm::string_view const config = args[3];
|
cm::string_view const config = args[3];
|
||||||
cm::string_view const executableConfig =
|
return cmQtAutoMocUic(infoFile, config) ? 0 : 1;
|
||||||
(args.size() >= 5) ? cm::string_view(args[4]) : cm::string_view();
|
|
||||||
return cmQtAutoMocUic(infoFile, config, executableConfig) ? 0 : 1;
|
|
||||||
}
|
}
|
||||||
if ((args[1] == "cmake_autorcc") && (args.size() >= 3)) {
|
if ((args[1] == "cmake_autorcc") && (args.size() >= 3)) {
|
||||||
cm::string_view const infoFile = args[2];
|
cm::string_view const infoFile = args[2];
|
||||||
cm::string_view const config =
|
cm::string_view const config =
|
||||||
(args.size() > 3) ? cm::string_view(args[3]) : cm::string_view();
|
(args.size() > 3) ? cm::string_view(args[3]) : cm::string_view();
|
||||||
cm::string_view const executableConfig =
|
return cmQtAutoRcc(infoFile, config) ? 0 : 1;
|
||||||
(args.size() >= 5) ? cm::string_view(args[4]) : cm::string_view();
|
|
||||||
return cmQtAutoRcc(infoFile, config, executableConfig) ? 0 : 1;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -151,10 +151,7 @@ if (DEFINED with_qt_version)
|
|||||||
# Touch just the library source file, which shouldn't cause a rerun of AUTOMOC
|
# Touch just the library source file, which shouldn't cause a rerun of AUTOMOC
|
||||||
# for app_with_qt target.
|
# for app_with_qt target.
|
||||||
file(TOUCH "${RunCMake_SOURCE_DIR}/simple_lib.cpp")
|
file(TOUCH "${RunCMake_SOURCE_DIR}/simple_lib.cpp")
|
||||||
set(RunCMake_TEST_NOT_EXPECT_stdout "Automatic MOC for target app_with_qt|\
|
|
||||||
Automatic MOC for target sub_exe_1|\
|
|
||||||
Automatic MOC for target sub_exe_2")
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-Don't execute AUTOMOC for 'app_with_qt', 'sub_exe_1' and 'sub_exe_2'")
|
|
||||||
# Build and assert that AUTOMOC was not run for app_with_qt, sub_exe_1 and sub_exe_2.
|
# Build and assert that AUTOMOC was not run for app_with_qt, sub_exe_1 and sub_exe_2.
|
||||||
run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose ${config_param})
|
run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose ${config_param})
|
||||||
unset(RunCMake_TEST_VARIANT_DESCRIPTION)
|
unset(RunCMake_TEST_VARIANT_DESCRIPTION)
|
||||||
@@ -172,13 +169,13 @@ Automatic MOC for target sub_exe_2")
|
|||||||
message(${message_type} "QtAutoMocDeps-build-\"${file}\" was generated - ${check_result}")
|
message(${message_type} "QtAutoMocDeps-build-\"${file}\" was generated - ${check_result}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
check_file_exists("${RunCMake_TEST_BINARY_DIR}/app_with_qt_autogen/deps${config_suffix}")
|
check_file_exists("${RunCMake_TEST_BINARY_DIR}/app_with_qt_autogen/deps")
|
||||||
check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir1/sub_exe_1_autogen/deps${config_suffix}")
|
check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir1/sub_exe_1_autogen/deps")
|
||||||
check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir2/sub_exe_2_autogen/deps${config_suffix}")
|
check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir2/sub_exe_2_autogen/deps")
|
||||||
|
|
||||||
check_file_exists("${RunCMake_TEST_BINARY_DIR}/app_with_qt_autogen/timestamp${config_suffix}")
|
check_file_exists("${RunCMake_TEST_BINARY_DIR}/app_with_qt_autogen/timestamp")
|
||||||
check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir1/sub_exe_1_autogen/timestamp${config_suffix}")
|
check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir1/sub_exe_1_autogen/timestamp")
|
||||||
check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir2/sub_exe_2_autogen/timestamp${config_suffix}")
|
check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir2/sub_exe_2_autogen/timestamp")
|
||||||
|
|
||||||
# Touch a header file to make sure an automoc dependency cycle is not introduced.
|
# Touch a header file to make sure an automoc dependency cycle is not introduced.
|
||||||
file(TOUCH "${RunCMake_SOURCE_DIR}/MyWindow.h")
|
file(TOUCH "${RunCMake_SOURCE_DIR}/MyWindow.h")
|
||||||
@@ -192,266 +189,4 @@ Automatic MOC for target sub_exe_2")
|
|||||||
endif()
|
endif()
|
||||||
endblock()
|
endblock()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(run_make_program dir)
|
|
||||||
execute_process(
|
|
||||||
COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN}
|
|
||||||
WORKING_DIRECTORY "${dir}"
|
|
||||||
OUTPUT_VARIABLE make_program_stdout
|
|
||||||
ERROR_VARIABLE make_program_stderr
|
|
||||||
RESULT_VARIABLE make_program_result
|
|
||||||
)
|
|
||||||
if (NOT DEFINED RunMakeProgram_expected_result)
|
|
||||||
set(RunMakeProgram_expected_result 0)
|
|
||||||
endif()
|
|
||||||
if(NOT "${make_program_result}" MATCHES "${RunMakeProgram_expected_result}")
|
|
||||||
message(STATUS "
|
|
||||||
============ beginning of ${RunCMake_MAKE_PROGRAM}'s stdout ============
|
|
||||||
${make_program_stdout}
|
|
||||||
=============== end of ${RunCMake_MAKE_PROGRAM}'s stdout ===============
|
|
||||||
")
|
|
||||||
message(STATUS "
|
|
||||||
============ beginning of ${RunCMake_MAKE_PROGRAM}'s stderr ============
|
|
||||||
${make_program_stderr}
|
|
||||||
=============== end of ${RunCMake_MAKE_PROGRAM}'s stderr ===============
|
|
||||||
")
|
|
||||||
message(FATAL_ERROR
|
|
||||||
"top ${RunCMake_MAKE_PROGRAM} build failed exited with status ${make_program_result}")
|
|
||||||
endif()
|
|
||||||
set(make_program_stdout "${make_program_stdout}" PARENT_SCOPE)
|
|
||||||
endfunction(run_make_program)
|
|
||||||
|
|
||||||
function(count_substring STRING SUBSTRING COUNT_VAR)
|
|
||||||
string(LENGTH "${STRING}" STRING_LENGTH)
|
|
||||||
string(LENGTH "${SUBSTRING}" SUBSTRING_LENGTH)
|
|
||||||
if (SUBSTRING_LENGTH EQUAL 0)
|
|
||||||
message(FATAL_ERROR "SUBSTRING_LENGTH is 0")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (STRING_LENGTH EQUAL 0)
|
|
||||||
message(FATAL_ERROR "STRING_LENGTH is 0")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (STRING_LENGTH LESS SUBSTRING_LENGTH)
|
|
||||||
message(FATAL_ERROR "STRING_LENGTH is less than SUBSTRING_LENGTH")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(COUNT 0)
|
|
||||||
string(FIND "${STRING}" "${SUBSTRING}" SUBSTRING_START)
|
|
||||||
while(SUBSTRING_START GREATER_EQUAL 0)
|
|
||||||
math(EXPR COUNT "${COUNT} + 1")
|
|
||||||
math(EXPR SUBSTRING_START "${SUBSTRING_START} + ${SUBSTRING_LENGTH}")
|
|
||||||
string(SUBSTRING "${STRING}" ${SUBSTRING_START} -1 STRING)
|
|
||||||
string(FIND "${STRING}" "${SUBSTRING}" SUBSTRING_START)
|
|
||||||
endwhile()
|
|
||||||
|
|
||||||
set(${COUNT_VAR} ${COUNT} PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(expect_only_once make_program_stdout expected_output test_name)
|
|
||||||
count_substring("${make_program_stdout}" "${expected_output}" count)
|
|
||||||
if(NOT count EQUAL 1)
|
|
||||||
message(STATUS "${test_name}-expect_only_once - FAILED")
|
|
||||||
message(FATAL_ERROR "Expected to find ${expected_output} exactly once in ${make_program_stdout} but found ${count} occurrences of ${expected_output}")
|
|
||||||
else()
|
|
||||||
message(STATUS "${test_name}-expect_only_once - PASSED")
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(expect_n_times string_to_check expected_output expected_count test_name)
|
|
||||||
count_substring("${string_to_check}" "${expected_output}" count)
|
|
||||||
if(NOT count EQUAL ${expected_count})
|
|
||||||
message(STATUS "${test_name}-expect_${expected_count}_times - FAILED")
|
|
||||||
message(FATAL_ERROR "Expected to find ${expected_output} exactly ${expected_count} times in ${string_to_check} but found ${count} occurrences of ${expected_output}")
|
|
||||||
else()
|
|
||||||
message(STATUS "${test_name}-expect_${expected_count}_times - PASSED")
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(not_expect make_program_stdout unexpected_output test_name)
|
|
||||||
count_substring("${make_program_stdout}" "${unexpected_output}" count)
|
|
||||||
if(NOT count EQUAL 0)
|
|
||||||
message(STATUS "${test_name}-not_expect - FAILED")
|
|
||||||
message(FATAL_ERROR "Expected to find ${unexpected_output} exactly 0 times in ${make_program_stdout} but found ${count} occurrences of ${unexpected_output}")
|
|
||||||
else()
|
|
||||||
message(STATUS "${test_name}-not_expect - PASSED")
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
if (QtCore_VERSION VERSION_GREATER_EQUAL 5.15.0)
|
|
||||||
foreach(exe IN ITEMS Moc Uic Rcc)
|
|
||||||
if(RunCMake_GENERATOR MATCHES "Ninja Multi-Config")
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMake-configure")
|
|
||||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig-multi-config-build)
|
|
||||||
run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_VERBOSE=ON)
|
|
||||||
unset(RunCMake_TEST_VARIANT_DESCRIPTION)
|
|
||||||
set(RunCMake_TEST_NO_CLEAN 1)
|
|
||||||
foreach(config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_EXPECT_stdout ".*running_exe_${config}*")
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-${config}-expect_running_exe_${config}")
|
|
||||||
run_cmake_command(Auto${exe}ExecutableConfig-multi-config-build ${CMAKE_COMMAND} --build . --config ${config})
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
set(RunCMake_TEST_EXPECT_stdout "ninja: no work to do")
|
|
||||||
foreach(config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-${config}-expect_no_work_to_do")
|
|
||||||
run_cmake_command(Auto${exe}ExecutableConfig-multi-config-build ${CMAKE_COMMAND} --build . --config ${config})
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
endblock()
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig-build)
|
|
||||||
run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_VERBOSE=ON)
|
|
||||||
foreach(config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
block()
|
|
||||||
run_make_program(${RunCMake_TEST_BINARY_DIR} --verbose -f build-${config}.ninja)
|
|
||||||
|
|
||||||
set(expected_output "running_exe_${config}")
|
|
||||||
expect_only_once("${make_program_stdout}" "${expected_output}" "Auto${exe}ExecutableConfig-${config}-${expected_output}")
|
|
||||||
|
|
||||||
foreach(sub_config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
if(NOT sub_config STREQUAL config)
|
|
||||||
set(unexpected_output "running_exe_${sub_config}")
|
|
||||||
not_expect("${make_program_stdout}" "${unexpected_output}" "Auto${exe}ExecutableConfig-${config}-${unexpected_output}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if (exe STREQUAL "Moc" OR exe STREQUAL "Uic")
|
|
||||||
set(expected_output "cmake_autogen")
|
|
||||||
else()
|
|
||||||
set(expected_output "cmake_autorcc")
|
|
||||||
endif()
|
|
||||||
expect_only_once("${make_program_stdout}" "${expected_output}" "Auto${exe}ExecutableConfig-${config}-${expected_output}")
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
endblock()
|
|
||||||
block()
|
|
||||||
foreach(ninja_config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
foreach(target_config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
block()
|
|
||||||
set(TEST_SUFFIX "-CrossConfig-${ninja_config}-${target_config}")
|
|
||||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig${TEST_SUFFIX}-build)
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION ${TEST_SUFFIX})
|
|
||||||
run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_CROSS_CONFIGS=all -DCMAKE_DEFAULT_BUILD_TYPE=${ninja_config})
|
|
||||||
unset(RunCMake_TEST_VARIANT_DESCRIPTION)
|
|
||||||
|
|
||||||
run_make_program(${RunCMake_TEST_BINARY_DIR} --verbose -f build-${ninja_config}.ninja dummy:${target_config})
|
|
||||||
|
|
||||||
set(expected_output "running_exe_${ninja_config}")
|
|
||||||
expect_only_once("${make_program_stdout}" "${expected_output}" "Auto${exe}ExecutableConfig${TEST_SUFFIX}-${expected_output}")
|
|
||||||
|
|
||||||
foreach(sub_config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
if(NOT sub_config STREQUAL ninja_config)
|
|
||||||
set(unexpected_output "running_exe_${sub_config}")
|
|
||||||
not_expect("${make_program_stdout}" "${unexpected_output}" "Auto${exe}ExecutableConfig${TEST_SUFFIX}-${unexpected_output}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if (exe STREQUAL "Moc" OR exe STREQUAL "Uic")
|
|
||||||
set(expected_output "cmake_autogen")
|
|
||||||
else()
|
|
||||||
set(expected_output "cmake_autorcc")
|
|
||||||
endif()
|
|
||||||
expect_only_once("${make_program_stdout}" "${expected_output}" "Auto${exe}ExecutableConfig${TEST_SUFFIX}-${expected_output}")
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
endforeach()
|
|
||||||
endblock()
|
|
||||||
block()
|
|
||||||
foreach(ninja_config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
set(TEST_SUFFIX "-CrossConfig-${ninja_config}-all-all")
|
|
||||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig${TEST_SUFFIX}-build)
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION ${TEST_SUFFIX})
|
|
||||||
run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_CROSS_CONFIGS=all)
|
|
||||||
unset(RunCMake_TEST_VARIANT_DESCRIPTION)
|
|
||||||
run_make_program(${RunCMake_TEST_BINARY_DIR} --verbose -f build-${ninja_config}.ninja all:all)
|
|
||||||
endforeach()
|
|
||||||
endblock()
|
|
||||||
elseif (RunCMake_GENERATOR MATCHES "Ninja|Make")
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig-build)
|
|
||||||
foreach(config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-${config}")
|
|
||||||
run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_BUILD_TYPE=${config} -DCMAKE_AUTOGEN_VERBOSE=ON)
|
|
||||||
unset(RunCMake_TEST_VARIANT_DESCRIPTION)
|
|
||||||
set(RunCMake_TEST_NO_CLEAN 1)
|
|
||||||
set(RunCMake_TEST_EXPECT_stdout ".*running_exe_${config}*")
|
|
||||||
run_cmake_command(Auto${exe}ExecutableConfig-${config}-build ${CMAKE_COMMAND} --build .)
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
endblock()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Visual Studio specific dependency tests
|
|
||||||
if (RunCMake_GENERATOR MATCHES "Visual Studio")
|
|
||||||
foreach(exe IN ITEMS Moc Uic Rcc)
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${exe}Example-build)
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMake-configure")
|
|
||||||
run_cmake_with_options(${exe}Example ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_VERBOSE=ON)
|
|
||||||
unset(RunCMake_TEST_VARIANT_DESCRIPTION)
|
|
||||||
set(RunCMake_TEST_NO_CLEAN 1)
|
|
||||||
foreach(config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-${config}-first-build")
|
|
||||||
run_cmake_command(${exe}Example-build ${CMAKE_COMMAND} --build . --config ${config})
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
foreach(config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
block()
|
|
||||||
if (exe STREQUAL "Moc" OR exe STREQUAL "Uic")
|
|
||||||
set(RunCMake_TEST_NOT_EXPECT_stdout "Auto${exe}")
|
|
||||||
set(not_expect_descripton "Auto${exe}")
|
|
||||||
else ()
|
|
||||||
set(RunCMake_TEST_NOT_EXPECT_stdout "qrc_data.cpp|Auto${exe}")
|
|
||||||
set(not_expect_descripton "qrc_data.cpp_and_Auto${exe}")
|
|
||||||
endif()
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-second-build-${config}_expect_no_${not_expect_descripton}")
|
|
||||||
run_cmake_command(${exe}Example-build ${CMAKE_COMMAND} --build . --config ${config})
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (RunCMake_GENERATOR MATCHES "Xcode")
|
|
||||||
foreach(exe IN ITEMS Moc Uic Rcc)
|
|
||||||
block()
|
|
||||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${exe}Example-build)
|
|
||||||
set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMake-configure")
|
|
||||||
set(RunCMake_TEST_EXPECT_stderr ".*")
|
|
||||||
run_cmake_with_options(${exe}Example ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_VERBOSE=ON)
|
|
||||||
set(RunCMake_TEST_NO_CLEAN 1)
|
|
||||||
set(RunCMake_MAKE_PROGRAM ${CMAKE_COMMAND})
|
|
||||||
run_make_program(${RunCMake_TEST_BINARY_DIR} --build . --config Debug)
|
|
||||||
if (exe STREQUAL "Moc")
|
|
||||||
set(expected_count 16)
|
|
||||||
elseif (exe STREQUAL "Uic")
|
|
||||||
set(expected_count 4)
|
|
||||||
else()
|
|
||||||
set(expected_count 12)
|
|
||||||
endif()
|
|
||||||
expect_n_times("${make_program_stdout}" "Auto${exe}:" ${expected_count} "${exe}Example-build-Auto${exe}")
|
|
||||||
expect_n_times("${make_program_stdout}" "Auto${exe}:" ${expected_count} "${exe}Example-build-Auto${exe}")
|
|
||||||
|
|
||||||
if (exe STREQUAL "Moc" OR exe STREQUAL "Uic")
|
|
||||||
expect_n_times("${make_program_stdout}" "AutoGen:" 20 "${exe}Example-build-AutoGen:")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(config IN ITEMS Debug Release RelWithDebInfo)
|
|
||||||
block()
|
|
||||||
run_make_program(${RunCMake_TEST_BINARY_DIR} --build . --config ${config})
|
|
||||||
not_expect("${make_program_stdout}" "Auto${exe}" "${exe}Example-${config}_Auto${exe}")
|
|
||||||
not_expect("${make_program_stdout}" "AutoGen:" "${exe}Example-${config}_AutoGen")
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
endblock()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
<!DOCTYPE RCC><RCC version="1.0">
|
|
||||||
<qresource prefix="/res/affine">
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#include "example.h"
|
|
||||||
|
|
||||||
Example::Example()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#ifndef EXAMPLE_H
|
|
||||||
#define EXAMPLE_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
|
|
||||||
class Example : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Example();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#include "example_ui.h"
|
|
||||||
|
|
||||||
Example::Example()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#ifndef EXAMPLE_UI_H
|
|
||||||
#define EXAMPLE_UI_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
|
|
||||||
#include "ui_uiA.h"
|
|
||||||
|
|
||||||
class Example : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Example();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#ifndef EXE_COMMON_H
|
|
||||||
#define EXE_COMMON_H
|
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <fstream>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
inline int runRealExe(const int argc, char** argv)
|
|
||||||
{
|
|
||||||
std::vector<std::string> args;
|
|
||||||
std::string realMocPath;
|
|
||||||
std::string const pathArg = "EXE_PATH=";
|
|
||||||
std::string cmd;
|
|
||||||
if (argc > 1) {
|
|
||||||
for (int i = 1; i < argc; ++i) {
|
|
||||||
std::string const arg = argv[i];
|
|
||||||
if (arg.find(pathArg) != std::string::npos) {
|
|
||||||
realMocPath = arg.substr(pathArg.length());
|
|
||||||
// if EXE_PATH contains spaces, wrap it in quotes
|
|
||||||
if (realMocPath.find(" ") != std::string::npos) {
|
|
||||||
realMocPath = "\"" + realMocPath + "\"";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
args.push_back(arg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
|
||||||
cmd += "cmd /C \"";
|
|
||||||
#endif
|
|
||||||
cmd += realMocPath + " ";
|
|
||||||
for (auto arg : args) {
|
|
||||||
// if arg contains spaces, wrap it in quotes
|
|
||||||
if (arg.find(' ') != std::string::npos) {
|
|
||||||
cmd += " \"" + arg + "\"";
|
|
||||||
} else {
|
|
||||||
cmd += " " + arg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
|
||||||
cmd += "\"";
|
|
||||||
#endif
|
|
||||||
std::cout << "Running real exe:" << cmd << std::endl;
|
|
||||||
return std::system(cmd.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "exe_common.h"
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
|
||||||
{
|
|
||||||
std::cout << "running_exe_Debug\n";
|
|
||||||
return runRealExe(argc, argv);
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "exe_common.h"
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
|
||||||
{
|
|
||||||
std::cout << "running_exe_Release\n";
|
|
||||||
return runRealExe(argc, argv);
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "exe_common.h"
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
|
||||||
{
|
|
||||||
std::cout << "running_exe_RelWithDebInfo\n";
|
|
||||||
return runRealExe(argc, argv);
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>UiA</class>
|
|
||||||
<widget class="QWidget" name="UiA">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>400</width>
|
|
||||||
<height>300</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QTreeView" name="treeView"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
Reference in New Issue
Block a user