2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2015-09-26 17:05:00 +00:00
|
|
|
#include "cmQtAutoGeneratorInitializer.h"
|
|
|
|
|
2016-09-01 18:59:28 +00:00
|
|
|
#include "cmAlgorithms.h"
|
|
|
|
#include "cmCustomCommandLines.h"
|
2016-12-01 08:24:48 +00:00
|
|
|
#include "cmFilePathChecksum.h"
|
2016-09-01 18:59:28 +00:00
|
|
|
#include "cmGeneratorTarget.h"
|
|
|
|
#include "cmGlobalGenerator.h"
|
2015-09-26 17:05:00 +00:00
|
|
|
#include "cmLocalGenerator.h"
|
|
|
|
#include "cmMakefile.h"
|
2016-09-01 18:59:28 +00:00
|
|
|
#include "cmOutputConverter.h"
|
2015-09-26 17:05:00 +00:00
|
|
|
#include "cmSourceFile.h"
|
2016-09-01 18:59:28 +00:00
|
|
|
#include "cmSourceFileLocation.h"
|
2016-10-18 19:28:49 +00:00
|
|
|
#include "cmState.h"
|
2016-09-01 18:59:28 +00:00
|
|
|
#include "cmSystemTools.h"
|
|
|
|
#include "cmTarget.h"
|
|
|
|
#include "cmake.h"
|
2015-09-26 17:05:00 +00:00
|
|
|
|
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
2016-05-16 14:34:04 +00:00
|
|
|
#include "cmGlobalVisualStudioGenerator.h"
|
2015-09-26 17:05:00 +00:00
|
|
|
#endif
|
|
|
|
|
2016-09-01 18:59:28 +00:00
|
|
|
#include <algorithm>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <cmConfigure.h>
|
|
|
|
#include <cmsys/FStream.hxx>
|
|
|
|
#include <cmsys/RegularExpression.hxx>
|
|
|
|
#include <map>
|
|
|
|
#include <set>
|
|
|
|
#include <sstream>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
2016-11-30 10:19:28 +00:00
|
|
|
static void utilCopyTargetProperty(cmTarget* destinationTarget,
|
|
|
|
cmTarget* sourceTarget,
|
|
|
|
const std::string& propertyName)
|
|
|
|
{
|
|
|
|
const char* propertyValue = sourceTarget->GetProperty(propertyName);
|
|
|
|
if (propertyValue) {
|
|
|
|
destinationTarget->SetProperty(propertyName, propertyValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static std::string utilStripCR(std::string const& line)
|
|
|
|
{
|
|
|
|
// Strip CR characters rcc may have printed (possibly more than one!).
|
|
|
|
std::string::size_type cr = line.find('\r');
|
|
|
|
if (cr != line.npos) {
|
|
|
|
return line.substr(0, cr);
|
|
|
|
}
|
|
|
|
return line;
|
|
|
|
}
|
|
|
|
|
2016-08-06 12:57:52 +00:00
|
|
|
static std::string GetAutogenTargetName(cmGeneratorTarget const* target)
|
|
|
|
{
|
|
|
|
std::string autogenTargetName = target->GetName();
|
2016-12-02 12:03:38 +00:00
|
|
|
autogenTargetName += "_autogen";
|
2016-08-06 12:57:52 +00:00
|
|
|
return autogenTargetName;
|
|
|
|
}
|
|
|
|
|
2016-11-30 10:25:57 +00:00
|
|
|
static std::string GetAutogenTargetFilesDir(cmGeneratorTarget const* target)
|
2016-08-06 12:57:52 +00:00
|
|
|
{
|
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
|
|
|
std::string targetDir = makefile->GetCurrentBinaryDirectory();
|
|
|
|
targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
|
|
|
|
targetDir += "/";
|
|
|
|
targetDir += GetAutogenTargetName(target);
|
|
|
|
targetDir += ".dir/";
|
|
|
|
return targetDir;
|
|
|
|
}
|
|
|
|
|
|
|
|
static std::string GetAutogenTargetBuildDir(cmGeneratorTarget const* target)
|
|
|
|
{
|
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
|
|
|
std::string targetDir = makefile->GetCurrentBinaryDirectory();
|
|
|
|
targetDir += "/";
|
|
|
|
targetDir += GetAutogenTargetName(target);
|
2016-11-30 21:56:50 +00:00
|
|
|
targetDir += "/";
|
2016-08-06 12:57:52 +00:00
|
|
|
return targetDir;
|
|
|
|
}
|
|
|
|
|
2016-12-02 11:10:51 +00:00
|
|
|
static std::string GetQtMajorVersion(cmGeneratorTarget const* target)
|
|
|
|
{
|
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
|
|
|
std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
|
|
|
|
if (qtMajorVersion.empty()) {
|
|
|
|
qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
|
|
|
|
}
|
|
|
|
const char* targetQtVersion =
|
|
|
|
target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "");
|
|
|
|
if (targetQtVersion != CM_NULLPTR) {
|
|
|
|
qtMajorVersion = targetQtVersion;
|
|
|
|
}
|
|
|
|
return qtMajorVersion;
|
|
|
|
}
|
|
|
|
|
2015-10-05 17:21:30 +00:00
|
|
|
static void SetupSourceFiles(cmGeneratorTarget const* target,
|
2016-12-28 10:56:20 +00:00
|
|
|
std::vector<std::string>& mocUicSources,
|
|
|
|
std::vector<std::string>& mocUicHeaders,
|
2016-12-31 10:17:07 +00:00
|
|
|
std::vector<std::string>& skipMocList,
|
|
|
|
std::vector<std::string>& skipUicList)
|
2015-10-05 16:45:21 +00:00
|
|
|
{
|
2015-10-05 17:21:30 +00:00
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
2015-10-05 16:45:21 +00:00
|
|
|
|
|
|
|
std::vector<cmSourceFile*> srcFiles;
|
2015-10-05 17:21:30 +00:00
|
|
|
target->GetConfigCommonSourceFiles(srcFiles);
|
2015-10-05 16:45:21 +00:00
|
|
|
|
2016-12-31 10:17:07 +00:00
|
|
|
const bool targetMoc = target->GetPropertyAsBool("AUTOMOC");
|
|
|
|
const bool targetUic = target->GetPropertyAsBool("AUTOUIC");
|
|
|
|
|
2016-12-01 08:24:48 +00:00
|
|
|
cmFilePathChecksum fpathCheckSum(makefile);
|
2016-05-16 14:34:04 +00:00
|
|
|
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
|
|
|
|
fileIt != srcFiles.end(); ++fileIt) {
|
2015-10-05 16:45:21 +00:00
|
|
|
cmSourceFile* sf = *fileIt;
|
2016-12-28 10:43:25 +00:00
|
|
|
const cmSystemTools::FileFormat fileType =
|
|
|
|
cmSystemTools::GetFileFormat(sf->GetExtension().c_str());
|
|
|
|
|
|
|
|
if (!(fileType == cmSystemTools::CXX_FILE_FORMAT) &&
|
|
|
|
!(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
|
|
|
|
continue;
|
|
|
|
}
|
2016-12-02 11:13:59 +00:00
|
|
|
const std::string absFile =
|
|
|
|
cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
2016-12-31 10:17:07 +00:00
|
|
|
// Skip flags
|
|
|
|
const bool skipAll =
|
|
|
|
cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOGEN"));
|
|
|
|
const bool skipMoc =
|
|
|
|
skipAll || cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
|
|
|
|
const bool skipUic =
|
|
|
|
skipAll || cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"));
|
|
|
|
// Add file name to skip lists.
|
|
|
|
// Do this even when the file is not added to the sources/headers lists
|
|
|
|
// because the file name may be extracted from an other file when
|
|
|
|
// processing
|
|
|
|
if (skipMoc) {
|
|
|
|
skipMocList.push_back(absFile);
|
2016-12-28 10:43:25 +00:00
|
|
|
}
|
2016-12-31 10:17:07 +00:00
|
|
|
if (skipUic) {
|
|
|
|
skipUicList.push_back(absFile);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2016-12-31 10:17:07 +00:00
|
|
|
|
|
|
|
if ((targetMoc && !skipMoc) || (targetUic && !skipUic)) {
|
|
|
|
// Add file name to sources or headers list
|
|
|
|
switch (fileType) {
|
|
|
|
case cmSystemTools::CXX_FILE_FORMAT:
|
|
|
|
mocUicSources.push_back(absFile);
|
|
|
|
break;
|
|
|
|
case cmSystemTools::HEADER_FILE_FORMAT:
|
|
|
|
mocUicHeaders.push_back(absFile);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2015-10-05 16:45:21 +00:00
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:45:21 +00:00
|
|
|
}
|
|
|
|
|
2015-10-05 17:21:30 +00:00
|
|
|
static void GetCompileDefinitionsAndDirectories(
|
2016-05-16 14:34:04 +00:00
|
|
|
cmGeneratorTarget const* target, const std::string& config,
|
|
|
|
std::string& incs, std::string& defs)
|
2015-10-05 16:46:11 +00:00
|
|
|
{
|
|
|
|
std::vector<std::string> includeDirs;
|
2016-05-16 14:34:04 +00:00
|
|
|
cmLocalGenerator* localGen = target->GetLocalGenerator();
|
2015-10-05 16:46:11 +00:00
|
|
|
// Get the include dirs for this target, without stripping the implicit
|
2016-08-12 19:06:35 +00:00
|
|
|
// include dirs off, see https://gitlab.kitware.com/cmake/cmake/issues/13667
|
2015-10-05 17:21:30 +00:00
|
|
|
localGen->GetIncludeDirectories(includeDirs, target, "CXX", config, false);
|
2015-10-05 16:46:11 +00:00
|
|
|
|
|
|
|
incs = cmJoin(includeDirs, ";");
|
|
|
|
|
|
|
|
std::set<std::string> defines;
|
2015-10-09 20:19:57 +00:00
|
|
|
localGen->AddCompileDefinitions(defines, target, config, "CXX");
|
2015-10-05 16:46:11 +00:00
|
|
|
|
|
|
|
defs += cmJoin(defines, ";");
|
|
|
|
}
|
|
|
|
|
2016-11-30 10:04:06 +00:00
|
|
|
static void MocSetupAutoTarget(
|
2016-05-16 14:34:04 +00:00
|
|
|
cmGeneratorTarget const* target, const std::string& autogenTargetName,
|
|
|
|
std::vector<std::string> const& skipMoc,
|
|
|
|
std::map<std::string, std::string>& configIncludes,
|
|
|
|
std::map<std::string, std::string>& configDefines)
|
2015-10-05 16:46:58 +00:00
|
|
|
{
|
2015-10-16 17:19:50 +00:00
|
|
|
cmLocalGenerator* lg = target->GetLocalGenerator();
|
2015-10-05 17:21:30 +00:00
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
2015-10-05 16:46:58 +00:00
|
|
|
|
|
|
|
const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
|
2016-06-27 20:44:16 +00:00
|
|
|
std::string _moc_options = (tmp != CM_NULLPTR ? tmp : "");
|
2016-05-16 14:34:04 +00:00
|
|
|
makefile->AddDefinition(
|
|
|
|
"_moc_options", cmOutputConverter::EscapeForCMake(_moc_options).c_str());
|
|
|
|
makefile->AddDefinition(
|
|
|
|
"_skip_moc",
|
|
|
|
cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str());
|
2015-10-05 16:46:58 +00:00
|
|
|
bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
|
|
|
|
makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
|
|
|
|
|
|
|
|
std::string _moc_incs;
|
|
|
|
std::string _moc_compile_defs;
|
|
|
|
std::vector<std::string> configs;
|
|
|
|
const std::string& config = makefile->GetConfigurations(configs);
|
2016-05-16 14:34:04 +00:00
|
|
|
GetCompileDefinitionsAndDirectories(target, config, _moc_incs,
|
|
|
|
_moc_compile_defs);
|
2015-10-05 16:46:58 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
makefile->AddDefinition(
|
|
|
|
"_moc_incs", cmOutputConverter::EscapeForCMake(_moc_incs).c_str());
|
|
|
|
makefile->AddDefinition(
|
|
|
|
"_moc_compile_defs",
|
|
|
|
cmOutputConverter::EscapeForCMake(_moc_compile_defs).c_str());
|
2015-10-05 16:46:58 +00:00
|
|
|
|
|
|
|
for (std::vector<std::string>::const_iterator li = configs.begin();
|
2016-05-16 14:34:04 +00:00
|
|
|
li != configs.end(); ++li) {
|
2015-10-05 16:46:58 +00:00
|
|
|
std::string config_moc_incs;
|
|
|
|
std::string config_moc_compile_defs;
|
2016-05-16 14:34:04 +00:00
|
|
|
GetCompileDefinitionsAndDirectories(target, *li, config_moc_incs,
|
2015-10-05 16:46:58 +00:00
|
|
|
config_moc_compile_defs);
|
2016-05-16 14:34:04 +00:00
|
|
|
if (config_moc_incs != _moc_incs) {
|
|
|
|
configIncludes[*li] = cmOutputConverter::EscapeForCMake(config_moc_incs);
|
|
|
|
if (_moc_incs.empty()) {
|
2015-10-05 16:46:58 +00:00
|
|
|
_moc_incs = config_moc_incs;
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
|
|
|
if (config_moc_compile_defs != _moc_compile_defs) {
|
2015-10-05 16:46:58 +00:00
|
|
|
configDefines[*li] =
|
2016-05-16 14:34:04 +00:00
|
|
|
cmOutputConverter::EscapeForCMake(config_moc_compile_defs);
|
|
|
|
if (_moc_compile_defs.empty()) {
|
2015-10-05 16:46:58 +00:00
|
|
|
_moc_compile_defs = config_moc_compile_defs;
|
|
|
|
}
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:46:58 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
const char* qtVersion = makefile->GetDefinition("_target_qt_version");
|
|
|
|
if (strcmp(qtVersion, "5") == 0) {
|
|
|
|
cmGeneratorTarget* qt5Moc = lg->FindGeneratorTargetToUse("Qt5::moc");
|
|
|
|
if (!qt5Moc) {
|
2015-10-05 16:46:58 +00:00
|
|
|
cmSystemTools::Error("Qt5::moc target not found ",
|
2016-05-16 14:34:04 +00:00
|
|
|
autogenTargetName.c_str());
|
2015-10-05 16:46:58 +00:00
|
|
|
return;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:46:58 +00:00
|
|
|
makefile->AddDefinition("_qt_moc_executable",
|
|
|
|
qt5Moc->ImportedGetLocation(""));
|
2016-05-16 14:34:04 +00:00
|
|
|
} else if (strcmp(qtVersion, "4") == 0) {
|
|
|
|
cmGeneratorTarget* qt4Moc = lg->FindGeneratorTargetToUse("Qt4::moc");
|
|
|
|
if (!qt4Moc) {
|
2015-10-05 16:46:58 +00:00
|
|
|
cmSystemTools::Error("Qt4::moc target not found ",
|
2016-05-16 14:34:04 +00:00
|
|
|
autogenTargetName.c_str());
|
2015-10-05 16:46:58 +00:00
|
|
|
return;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:46:58 +00:00
|
|
|
makefile->AddDefinition("_qt_moc_executable",
|
|
|
|
qt4Moc->ImportedGetLocation(""));
|
2016-05-16 14:34:04 +00:00
|
|
|
} else {
|
2015-10-05 16:46:58 +00:00
|
|
|
cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and "
|
2016-05-16 14:34:04 +00:00
|
|
|
"Qt 5 ",
|
|
|
|
autogenTargetName.c_str());
|
|
|
|
}
|
2015-10-05 16:46:58 +00:00
|
|
|
}
|
|
|
|
|
2016-11-30 09:23:20 +00:00
|
|
|
static void UicGetOpts(cmGeneratorTarget const* target,
|
2016-05-16 14:34:04 +00:00
|
|
|
const std::string& config, std::string& optString)
|
2015-10-05 16:47:49 +00:00
|
|
|
{
|
|
|
|
std::vector<std::string> opts;
|
2015-10-05 17:21:30 +00:00
|
|
|
target->GetAutoUicOptions(opts, config);
|
2015-10-05 16:47:49 +00:00
|
|
|
optString = cmJoin(opts, ";");
|
|
|
|
}
|
|
|
|
|
2016-11-30 10:04:58 +00:00
|
|
|
static void UicSetupAutoTarget(
|
2016-05-16 14:34:04 +00:00
|
|
|
cmGeneratorTarget const* target, std::vector<std::string> const& skipUic,
|
|
|
|
std::map<std::string, std::string>& configUicOptions)
|
2015-10-05 16:48:41 +00:00
|
|
|
{
|
2015-10-16 17:19:50 +00:00
|
|
|
cmLocalGenerator* lg = target->GetLocalGenerator();
|
2016-05-16 14:34:04 +00:00
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
2015-10-05 16:48:41 +00:00
|
|
|
|
|
|
|
std::set<std::string> skipped;
|
|
|
|
skipped.insert(skipUic.begin(), skipUic.end());
|
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
makefile->AddDefinition(
|
|
|
|
"_skip_uic",
|
|
|
|
cmOutputConverter::EscapeForCMake(cmJoin(skipUic, ";")).c_str());
|
2015-10-05 16:48:41 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
std::vector<cmSourceFile*> uiFilesWithOptions =
|
|
|
|
makefile->GetQtUiFilesWithOptions();
|
2015-10-05 16:48:41 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
const char* qtVersion = makefile->GetDefinition("_target_qt_version");
|
2015-10-05 16:48:41 +00:00
|
|
|
|
|
|
|
std::string _uic_opts;
|
|
|
|
std::vector<std::string> configs;
|
|
|
|
const std::string& config = makefile->GetConfigurations(configs);
|
2016-11-30 09:23:20 +00:00
|
|
|
UicGetOpts(target, config, _uic_opts);
|
2015-10-05 16:48:41 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!_uic_opts.empty()) {
|
2015-10-05 16:48:41 +00:00
|
|
|
_uic_opts = cmOutputConverter::EscapeForCMake(_uic_opts);
|
|
|
|
makefile->AddDefinition("_uic_target_options", _uic_opts.c_str());
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:48:41 +00:00
|
|
|
for (std::vector<std::string>::const_iterator li = configs.begin();
|
2016-05-16 14:34:04 +00:00
|
|
|
li != configs.end(); ++li) {
|
2015-10-05 16:48:41 +00:00
|
|
|
std::string config_uic_opts;
|
2016-11-30 09:23:20 +00:00
|
|
|
UicGetOpts(target, *li, config_uic_opts);
|
2016-05-16 14:34:04 +00:00
|
|
|
if (config_uic_opts != _uic_opts) {
|
2015-10-05 16:48:41 +00:00
|
|
|
configUicOptions[*li] =
|
2016-05-16 14:34:04 +00:00
|
|
|
cmOutputConverter::EscapeForCMake(config_uic_opts);
|
|
|
|
if (_uic_opts.empty()) {
|
2015-10-05 16:48:41 +00:00
|
|
|
_uic_opts = config_uic_opts;
|
|
|
|
}
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:48:41 +00:00
|
|
|
|
|
|
|
std::string uiFileFiles;
|
|
|
|
std::string uiFileOptions;
|
|
|
|
const char* sep = "";
|
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
for (std::vector<cmSourceFile*>::const_iterator fileIt =
|
|
|
|
uiFilesWithOptions.begin();
|
|
|
|
fileIt != uiFilesWithOptions.end(); ++fileIt) {
|
2015-10-05 16:48:41 +00:00
|
|
|
cmSourceFile* sf = *fileIt;
|
2016-05-16 14:34:04 +00:00
|
|
|
std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
2015-10-05 16:48:41 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!skipped.insert(absFile).second) {
|
2015-10-05 16:48:41 +00:00
|
|
|
continue;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:48:41 +00:00
|
|
|
uiFileFiles += sep;
|
|
|
|
uiFileFiles += absFile;
|
|
|
|
uiFileOptions += sep;
|
|
|
|
std::string opts = sf->GetProperty("AUTOUIC_OPTIONS");
|
|
|
|
cmSystemTools::ReplaceString(opts, ";", "@list_sep@");
|
|
|
|
uiFileOptions += opts;
|
|
|
|
sep = ";";
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:48:41 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
makefile->AddDefinition(
|
|
|
|
"_qt_uic_options_files",
|
|
|
|
cmOutputConverter::EscapeForCMake(uiFileFiles).c_str());
|
|
|
|
makefile->AddDefinition(
|
|
|
|
"_qt_uic_options_options",
|
|
|
|
cmOutputConverter::EscapeForCMake(uiFileOptions).c_str());
|
2015-10-05 16:48:41 +00:00
|
|
|
|
|
|
|
std::string targetName = target->GetName();
|
2016-05-16 14:34:04 +00:00
|
|
|
if (strcmp(qtVersion, "5") == 0) {
|
|
|
|
cmGeneratorTarget* qt5Uic = lg->FindGeneratorTargetToUse("Qt5::uic");
|
|
|
|
if (!qt5Uic) {
|
2015-10-05 16:48:41 +00:00
|
|
|
// Project does not use Qt5Widgets, but has AUTOUIC ON anyway
|
2016-05-16 14:34:04 +00:00
|
|
|
} else {
|
2015-10-05 16:48:41 +00:00
|
|
|
makefile->AddDefinition("_qt_uic_executable",
|
|
|
|
qt5Uic->ImportedGetLocation(""));
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
} else if (strcmp(qtVersion, "4") == 0) {
|
|
|
|
cmGeneratorTarget* qt4Uic = lg->FindGeneratorTargetToUse("Qt4::uic");
|
|
|
|
if (!qt4Uic) {
|
|
|
|
cmSystemTools::Error("Qt4::uic target not found ", targetName.c_str());
|
2015-10-05 16:48:41 +00:00
|
|
|
return;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:48:41 +00:00
|
|
|
makefile->AddDefinition("_qt_uic_executable",
|
|
|
|
qt4Uic->ImportedGetLocation(""));
|
2016-05-16 14:34:04 +00:00
|
|
|
} else {
|
2015-10-05 16:48:41 +00:00
|
|
|
cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and "
|
2016-05-16 14:34:04 +00:00
|
|
|
"Qt 5 ",
|
|
|
|
targetName.c_str());
|
|
|
|
}
|
2015-10-05 16:48:41 +00:00
|
|
|
}
|
|
|
|
|
2016-12-02 11:10:51 +00:00
|
|
|
static std::string RccGetExecutable(cmGeneratorTarget const* target,
|
|
|
|
const std::string& qtMajorVersion)
|
2015-10-05 16:50:00 +00:00
|
|
|
{
|
2015-10-16 17:19:50 +00:00
|
|
|
cmLocalGenerator* lg = target->GetLocalGenerator();
|
2015-10-05 16:50:00 +00:00
|
|
|
|
2016-12-02 11:10:51 +00:00
|
|
|
std::string const& targetName = target->GetName();
|
|
|
|
if (qtMajorVersion == "5") {
|
2016-05-16 14:34:04 +00:00
|
|
|
cmGeneratorTarget* qt5Rcc = lg->FindGeneratorTargetToUse("Qt5::rcc");
|
|
|
|
if (!qt5Rcc) {
|
|
|
|
cmSystemTools::Error("Qt5::rcc target not found ", targetName.c_str());
|
2015-10-05 16:50:00 +00:00
|
|
|
return std::string();
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
return qt5Rcc->ImportedGetLocation("");
|
2016-08-18 18:36:29 +00:00
|
|
|
}
|
2016-12-02 11:10:51 +00:00
|
|
|
if (qtMajorVersion == "4") {
|
2016-05-16 14:34:04 +00:00
|
|
|
cmGeneratorTarget* qt4Rcc = lg->FindGeneratorTargetToUse("Qt4::rcc");
|
|
|
|
if (!qt4Rcc) {
|
|
|
|
cmSystemTools::Error("Qt4::rcc target not found ", targetName.c_str());
|
2015-10-05 16:50:00 +00:00
|
|
|
return std::string();
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
return qt4Rcc->ImportedGetLocation("");
|
|
|
|
}
|
2015-10-05 16:50:00 +00:00
|
|
|
|
|
|
|
cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
|
2016-05-16 14:34:04 +00:00
|
|
|
"Qt 5 ",
|
|
|
|
targetName.c_str());
|
2015-10-05 16:50:00 +00:00
|
|
|
return std::string();
|
|
|
|
}
|
|
|
|
|
2016-11-30 09:19:33 +00:00
|
|
|
static void RccMergeOptions(std::vector<std::string>& opts,
|
2016-05-16 14:34:04 +00:00
|
|
|
const std::vector<std::string>& fileOpts,
|
|
|
|
bool isQt5)
|
2015-10-05 16:50:47 +00:00
|
|
|
{
|
2016-05-16 14:34:04 +00:00
|
|
|
static const char* valueOptions[] = { "name", "root", "compress",
|
|
|
|
"threshold" };
|
2015-10-05 16:50:47 +00:00
|
|
|
std::vector<std::string> extraOpts;
|
2016-05-16 14:34:04 +00:00
|
|
|
for (std::vector<std::string>::const_iterator it = fileOpts.begin();
|
|
|
|
it != fileOpts.end(); ++it) {
|
|
|
|
std::vector<std::string>::iterator existingIt =
|
|
|
|
std::find(opts.begin(), opts.end(), *it);
|
|
|
|
if (existingIt != opts.end()) {
|
|
|
|
const char* o = it->c_str();
|
|
|
|
if (*o == '-') {
|
2015-10-05 16:50:47 +00:00
|
|
|
++o;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
|
|
|
if (isQt5 && *o == '-') {
|
2015-10-05 16:50:47 +00:00
|
|
|
++o;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:50:47 +00:00
|
|
|
if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions),
|
2016-05-16 14:34:04 +00:00
|
|
|
cmStrCmp(*it)) != cmArrayEnd(valueOptions)) {
|
2015-10-05 16:50:47 +00:00
|
|
|
assert(existingIt + 1 != opts.end());
|
|
|
|
*(existingIt + 1) = *(it + 1);
|
|
|
|
++it;
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
} else {
|
2015-10-05 16:50:47 +00:00
|
|
|
extraOpts.push_back(*it);
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:50:47 +00:00
|
|
|
opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
|
|
|
|
}
|
|
|
|
|
2016-09-30 08:47:01 +00:00
|
|
|
/// @brief Reads the resource files list from from a .qrc file - Qt5 version
|
|
|
|
/// @return True if the .qrc file was successfully parsed
|
2016-11-30 09:13:26 +00:00
|
|
|
static bool RccListInputsQt5(cmSourceFile* sf, cmGeneratorTarget const* target,
|
2016-09-30 08:47:01 +00:00
|
|
|
std::vector<std::string>& depends)
|
2015-09-26 17:05:00 +00:00
|
|
|
{
|
2016-12-02 11:10:51 +00:00
|
|
|
const std::string rccCommand = RccGetExecutable(target, "5");
|
|
|
|
if (rccCommand.empty()) {
|
|
|
|
cmSystemTools::Error("AUTOGEN: error: rcc executable not available\n");
|
|
|
|
return false;
|
|
|
|
}
|
2015-10-28 13:00:51 +00:00
|
|
|
|
|
|
|
bool hasDashDashList = false;
|
2016-09-30 08:47:01 +00:00
|
|
|
// Read rcc features
|
2015-10-28 13:00:51 +00:00
|
|
|
{
|
2016-05-16 14:34:04 +00:00
|
|
|
std::vector<std::string> command;
|
|
|
|
command.push_back(rccCommand);
|
|
|
|
command.push_back("--help");
|
|
|
|
std::string rccStdOut;
|
|
|
|
std::string rccStdErr;
|
|
|
|
int retVal = 0;
|
2016-06-27 20:44:16 +00:00
|
|
|
bool result =
|
|
|
|
cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal,
|
|
|
|
CM_NULLPTR, cmSystemTools::OUTPUT_NONE);
|
2016-05-16 14:34:04 +00:00
|
|
|
if (result && retVal == 0 &&
|
|
|
|
rccStdOut.find("--list") != std::string::npos) {
|
|
|
|
hasDashDashList = true;
|
2015-10-28 13:00:51 +00:00
|
|
|
}
|
|
|
|
}
|
2016-09-30 08:47:01 +00:00
|
|
|
// Run rcc list command
|
2015-09-26 17:05:00 +00:00
|
|
|
std::vector<std::string> command;
|
|
|
|
command.push_back(rccCommand);
|
2016-05-16 14:34:04 +00:00
|
|
|
command.push_back(hasDashDashList ? "--list" : "-list");
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
2015-09-26 17:05:00 +00:00
|
|
|
command.push_back(absFile);
|
|
|
|
|
|
|
|
std::string rccStdOut;
|
|
|
|
std::string rccStdErr;
|
|
|
|
int retVal = 0;
|
2016-06-27 20:44:16 +00:00
|
|
|
bool result =
|
|
|
|
cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal,
|
|
|
|
CM_NULLPTR, cmSystemTools::OUTPUT_NONE);
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!result || retVal) {
|
2016-06-14 20:37:36 +00:00
|
|
|
std::ostringstream err;
|
2016-04-24 13:00:26 +00:00
|
|
|
err << "AUTOGEN: error: Rcc list process for " << sf->GetFullPath()
|
2016-05-16 14:34:04 +00:00
|
|
|
<< " failed:\n"
|
|
|
|
<< rccStdOut << "\n"
|
|
|
|
<< rccStdErr << std::endl;
|
2016-09-30 08:58:48 +00:00
|
|
|
cmSystemTools::Error(err.str().c_str());
|
2016-09-30 08:47:01 +00:00
|
|
|
return false;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2016-09-30 08:47:01 +00:00
|
|
|
// Parse rcc list output
|
2015-09-26 17:05:00 +00:00
|
|
|
{
|
2016-05-16 14:34:04 +00:00
|
|
|
std::istringstream ostr(rccStdOut);
|
|
|
|
std::string oline;
|
|
|
|
while (std::getline(ostr, oline)) {
|
2016-11-30 09:17:41 +00:00
|
|
|
oline = utilStripCR(oline);
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!oline.empty()) {
|
2016-09-30 08:47:01 +00:00
|
|
|
depends.push_back(oline);
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2016-05-16 14:34:04 +00:00
|
|
|
std::istringstream estr(rccStdErr);
|
|
|
|
std::string eline;
|
|
|
|
while (std::getline(estr, eline)) {
|
2016-11-30 09:17:41 +00:00
|
|
|
eline = utilStripCR(eline);
|
2016-05-16 14:34:04 +00:00
|
|
|
if (cmHasLiteralPrefix(eline, "RCC: Error in")) {
|
|
|
|
static std::string searchString = "Cannot find file '";
|
|
|
|
|
|
|
|
std::string::size_type pos = eline.find(searchString);
|
|
|
|
if (pos == std::string::npos) {
|
2016-06-14 20:37:36 +00:00
|
|
|
std::ostringstream err;
|
2016-05-16 14:34:04 +00:00
|
|
|
err << "AUTOGEN: error: Rcc lists unparsable output " << eline
|
|
|
|
<< std::endl;
|
2016-09-30 08:58:48 +00:00
|
|
|
cmSystemTools::Error(err.str().c_str());
|
2016-09-30 08:47:01 +00:00
|
|
|
return false;
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
pos += searchString.length();
|
|
|
|
std::string::size_type sz = eline.size() - pos - 1;
|
2016-09-30 08:47:01 +00:00
|
|
|
depends.push_back(eline.substr(pos, sz));
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-30 08:47:01 +00:00
|
|
|
return true;
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
|
|
|
|
2016-09-30 08:47:01 +00:00
|
|
|
/// @brief Reads the resource files list from from a .qrc file - Qt4 version
|
|
|
|
/// @return True if the .qrc file was successfully parsed
|
2016-11-30 09:13:26 +00:00
|
|
|
static bool RccListInputsQt4(cmSourceFile* sf,
|
2016-09-30 08:47:01 +00:00
|
|
|
std::vector<std::string>& depends)
|
2015-09-26 17:05:00 +00:00
|
|
|
{
|
2016-11-30 09:04:19 +00:00
|
|
|
// Read file into string
|
|
|
|
std::string qrcContents;
|
|
|
|
{
|
|
|
|
std::ostringstream stream;
|
|
|
|
stream << cmsys::ifstream(sf->GetFullPath().c_str()).rdbuf();
|
|
|
|
qrcContents = stream.str();
|
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
|
|
|
cmsys::RegularExpression fileMatchRegex("(<file[^<]+)");
|
|
|
|
|
|
|
|
size_t offset = 0;
|
2016-05-16 14:34:04 +00:00
|
|
|
while (fileMatchRegex.find(qrcContents.c_str() + offset)) {
|
2015-09-26 17:05:00 +00:00
|
|
|
std::string qrcEntry = fileMatchRegex.match(1);
|
|
|
|
|
|
|
|
offset += qrcEntry.size();
|
|
|
|
|
|
|
|
cmsys::RegularExpression fileReplaceRegex("(^<file[^>]*>)");
|
|
|
|
fileReplaceRegex.find(qrcEntry);
|
|
|
|
std::string tag = fileReplaceRegex.match(1);
|
|
|
|
|
|
|
|
qrcEntry = qrcEntry.substr(tag.size());
|
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!cmSystemTools::FileIsFullPath(qrcEntry.c_str())) {
|
2015-09-26 17:05:00 +00:00
|
|
|
qrcEntry = sf->GetLocation().GetDirectory() + "/" + qrcEntry;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
|
|
|
depends.push_back(qrcEntry);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2016-09-30 08:47:01 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// @brief Reads the resource files list from from a .qrc file
|
|
|
|
/// @return True if the rcc file was successfully parsed
|
2016-11-30 09:13:26 +00:00
|
|
|
static bool RccListInputs(const std::string& qtMajorVersion, cmSourceFile* sf,
|
|
|
|
cmGeneratorTarget const* target,
|
|
|
|
std::vector<std::string>& depends)
|
2016-09-30 08:47:01 +00:00
|
|
|
{
|
|
|
|
if (qtMajorVersion == "5") {
|
2016-11-30 09:13:26 +00:00
|
|
|
return RccListInputsQt5(sf, target, depends);
|
2016-09-30 08:47:01 +00:00
|
|
|
}
|
2016-11-30 09:13:26 +00:00
|
|
|
return RccListInputsQt4(sf, depends);
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
|
|
|
|
2016-12-02 11:10:51 +00:00
|
|
|
static void RccSetupAutoTarget(cmGeneratorTarget const* target,
|
|
|
|
const std::string& qtMajorVersion)
|
2015-10-05 16:55:09 +00:00
|
|
|
{
|
|
|
|
std::string _rcc_files;
|
|
|
|
const char* sepRccFiles = "";
|
2016-05-16 14:34:04 +00:00
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
2015-10-05 16:55:09 +00:00
|
|
|
|
|
|
|
std::vector<cmSourceFile*> srcFiles;
|
2015-10-05 17:21:30 +00:00
|
|
|
target->GetConfigCommonSourceFiles(srcFiles);
|
2015-10-05 16:55:09 +00:00
|
|
|
|
|
|
|
std::string qrcInputs;
|
|
|
|
const char* qrcInputsSep = "";
|
|
|
|
|
|
|
|
std::string rccFileFiles;
|
|
|
|
std::string rccFileOptions;
|
2016-05-16 14:34:04 +00:00
|
|
|
const char* optionSep = "";
|
2015-10-05 16:55:09 +00:00
|
|
|
|
2016-12-02 11:10:51 +00:00
|
|
|
const bool qtMajorVersion5 = (qtMajorVersion == "5");
|
2015-10-05 16:55:09 +00:00
|
|
|
|
|
|
|
std::vector<std::string> rccOptions;
|
2016-05-16 14:34:04 +00:00
|
|
|
if (const char* opts = target->GetProperty("AUTORCC_OPTIONS")) {
|
2015-10-05 16:55:09 +00:00
|
|
|
cmSystemTools::ExpandListArgument(opts, rccOptions);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:55:09 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
|
|
|
|
fileIt != srcFiles.end(); ++fileIt) {
|
2015-10-05 16:55:09 +00:00
|
|
|
cmSourceFile* sf = *fileIt;
|
|
|
|
std::string ext = sf->GetExtension();
|
2016-05-16 14:34:04 +00:00
|
|
|
if (ext == "qrc") {
|
|
|
|
std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
2016-12-28 11:01:31 +00:00
|
|
|
const bool skip =
|
|
|
|
cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOGEN")) ||
|
|
|
|
cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
|
2015-10-05 16:55:09 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!skip) {
|
2015-10-05 16:55:09 +00:00
|
|
|
_rcc_files += sepRccFiles;
|
|
|
|
_rcc_files += absFile;
|
|
|
|
sepRccFiles = ";";
|
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (const char* prop = sf->GetProperty("AUTORCC_OPTIONS")) {
|
2015-10-05 16:55:09 +00:00
|
|
|
std::vector<std::string> optsVec;
|
|
|
|
cmSystemTools::ExpandListArgument(prop, optsVec);
|
2016-12-02 11:10:51 +00:00
|
|
|
RccMergeOptions(rccOptions, optsVec, qtMajorVersion5);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:55:09 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!rccOptions.empty()) {
|
2015-10-05 16:55:09 +00:00
|
|
|
rccFileFiles += optionSep;
|
|
|
|
rccFileFiles += absFile;
|
|
|
|
rccFileOptions += optionSep;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
|
|
|
const char* listSep = "";
|
|
|
|
for (std::vector<std::string>::const_iterator it = rccOptions.begin();
|
|
|
|
it != rccOptions.end(); ++it) {
|
2015-10-05 16:55:09 +00:00
|
|
|
rccFileOptions += listSep;
|
|
|
|
rccFileOptions += *it;
|
|
|
|
listSep = "@list_sep@";
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:55:09 +00:00
|
|
|
optionSep = ";";
|
|
|
|
|
|
|
|
std::string entriesList;
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
|
2016-09-30 08:47:01 +00:00
|
|
|
std::vector<std::string> depends;
|
2016-11-30 09:13:26 +00:00
|
|
|
if (RccListInputs(qtMajorVersion, sf, target, depends)) {
|
2016-09-30 08:47:01 +00:00
|
|
|
entriesList = cmJoin(depends, "@list_sep@");
|
2016-05-16 14:34:04 +00:00
|
|
|
} else {
|
2015-10-05 16:55:09 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-10-05 16:55:09 +00:00
|
|
|
qrcInputs += qrcInputsSep;
|
|
|
|
qrcInputs += entriesList;
|
|
|
|
qrcInputsSep = ";";
|
|
|
|
}
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
|
|
|
makefile->AddDefinition(
|
2016-11-30 12:42:55 +00:00
|
|
|
"_rcc_inputs", cmOutputConverter::EscapeForCMake(qrcInputs).c_str());
|
2016-05-16 14:34:04 +00:00
|
|
|
makefile->AddDefinition(
|
|
|
|
"_rcc_files", cmOutputConverter::EscapeForCMake(_rcc_files).c_str());
|
|
|
|
makefile->AddDefinition(
|
2016-11-30 12:42:55 +00:00
|
|
|
"_rcc_options_files",
|
2016-05-16 14:34:04 +00:00
|
|
|
cmOutputConverter::EscapeForCMake(rccFileFiles).c_str());
|
|
|
|
makefile->AddDefinition(
|
2016-11-30 12:42:55 +00:00
|
|
|
"_rcc_options_options",
|
2016-05-16 14:34:04 +00:00
|
|
|
cmOutputConverter::EscapeForCMake(rccFileOptions).c_str());
|
2015-10-05 16:55:09 +00:00
|
|
|
makefile->AddDefinition("_qt_rcc_executable",
|
2016-12-02 11:10:51 +00:00
|
|
|
RccGetExecutable(target, qtMajorVersion).c_str());
|
2015-10-05 16:55:09 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2015-10-05 17:21:30 +00:00
|
|
|
void cmQtAutoGeneratorInitializer::InitializeAutogenSources(
|
2016-05-16 14:34:04 +00:00
|
|
|
cmGeneratorTarget* target)
|
2015-09-26 17:05:00 +00:00
|
|
|
{
|
2016-05-16 14:34:04 +00:00
|
|
|
if (target->GetPropertyAsBool("AUTOMOC")) {
|
2016-11-30 21:51:00 +00:00
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
2016-12-02 10:21:52 +00:00
|
|
|
const std::string mocCppFile =
|
|
|
|
GetAutogenTargetBuildDir(target) + "moc_compilation.cpp";
|
2016-12-28 11:15:11 +00:00
|
|
|
cmSourceFile* gf = makefile->GetOrCreateSource(mocCppFile, true);
|
|
|
|
gf->SetProperty("SKIP_AUTOGEN", "On");
|
2015-08-29 16:10:19 +00:00
|
|
|
target->AddSource(mocCppFile);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
2016-05-16 14:34:04 +00:00
|
|
|
cmLocalGenerator* lg, cmGeneratorTarget* target)
|
2015-09-26 17:05:00 +00:00
|
|
|
{
|
2015-10-05 17:21:30 +00:00
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2016-11-30 15:38:31 +00:00
|
|
|
// Create a custom target for running generators at buildtime
|
|
|
|
const std::string autogenTargetName = GetAutogenTargetName(target);
|
2016-12-02 10:21:52 +00:00
|
|
|
const std::string autogenBuildDir = GetAutogenTargetBuildDir(target);
|
2016-11-30 15:38:31 +00:00
|
|
|
const std::string workingDirectory =
|
|
|
|
cmSystemTools::CollapseFullPath("", makefile->GetCurrentBinaryDirectory());
|
2016-12-02 11:10:51 +00:00
|
|
|
const std::string qtMajorVersion = GetQtMajorVersion(target);
|
2016-12-02 16:20:25 +00:00
|
|
|
std::vector<std::string> autogenOutputFiles;
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2017-01-11 23:49:58 +00:00
|
|
|
// Remove old settings on cleanup
|
|
|
|
{
|
|
|
|
std::string fname = GetAutogenTargetFilesDir(target);
|
|
|
|
fname += "/AutogenOldSettings.cmake";
|
|
|
|
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", fname.c_str(),
|
|
|
|
false);
|
|
|
|
}
|
|
|
|
|
2016-12-02 16:20:25 +00:00
|
|
|
// Create autogen target build directory and add it to the clean files
|
2016-12-02 10:21:52 +00:00
|
|
|
cmSystemTools::MakeDirectory(autogenBuildDir);
|
2016-12-02 10:32:12 +00:00
|
|
|
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
|
|
|
|
autogenBuildDir.c_str(), false);
|
2016-12-02 10:21:52 +00:00
|
|
|
|
|
|
|
if (target->GetPropertyAsBool("AUTOMOC") ||
|
|
|
|
target->GetPropertyAsBool("AUTOUIC")) {
|
2016-12-02 16:20:25 +00:00
|
|
|
// Create autogen target includes directory and
|
|
|
|
// add it to the origin target INCLUDE_DIRECTORIES
|
2016-12-02 10:21:52 +00:00
|
|
|
const std::string incsDir = autogenBuildDir + "include";
|
|
|
|
cmSystemTools::MakeDirectory(incsDir);
|
|
|
|
target->AddIncludeDirectory(incsDir, true);
|
|
|
|
}
|
|
|
|
|
2016-12-02 16:20:25 +00:00
|
|
|
if (target->GetPropertyAsBool("AUTOMOC")) {
|
|
|
|
// Register moc compilation file as generated
|
2016-12-02 16:21:40 +00:00
|
|
|
autogenOutputFiles.push_back(autogenBuildDir + "moc_compilation.cpp");
|
2016-12-02 16:20:25 +00:00
|
|
|
}
|
|
|
|
|
2016-11-30 16:47:16 +00:00
|
|
|
// Initialize autogen target dependencies
|
2015-09-26 17:05:00 +00:00
|
|
|
std::vector<std::string> depends;
|
2016-05-16 14:34:04 +00:00
|
|
|
if (const char* autogenDepends =
|
|
|
|
target->GetProperty("AUTOGEN_TARGET_DEPENDS")) {
|
2015-09-26 17:05:00 +00:00
|
|
|
cmSystemTools::ExpandListArgument(autogenDepends, depends);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2016-11-30 15:38:31 +00:00
|
|
|
|
|
|
|
// Compose command lines
|
|
|
|
cmCustomCommandLines commandLines;
|
|
|
|
{
|
|
|
|
cmCustomCommandLine currentLine;
|
|
|
|
currentLine.push_back(cmSystemTools::GetCMakeCommand());
|
|
|
|
currentLine.push_back("-E");
|
|
|
|
currentLine.push_back("cmake_autogen");
|
|
|
|
currentLine.push_back(GetAutogenTargetFilesDir(target));
|
|
|
|
currentLine.push_back("$<CONFIGURATION>");
|
|
|
|
commandLines.push_back(currentLine);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2016-11-30 15:38:31 +00:00
|
|
|
// Compose target comment
|
|
|
|
std::string autogenComment;
|
|
|
|
{
|
|
|
|
std::vector<std::string> toolNames;
|
|
|
|
if (target->GetPropertyAsBool("AUTOMOC")) {
|
2016-11-30 21:12:50 +00:00
|
|
|
toolNames.push_back("MOC");
|
2016-11-30 15:38:31 +00:00
|
|
|
}
|
|
|
|
if (target->GetPropertyAsBool("AUTOUIC")) {
|
2016-11-30 21:12:50 +00:00
|
|
|
toolNames.push_back("UIC");
|
2016-11-30 15:38:31 +00:00
|
|
|
}
|
|
|
|
if (target->GetPropertyAsBool("AUTORCC")) {
|
2016-11-30 21:12:50 +00:00
|
|
|
toolNames.push_back("RCC");
|
2016-11-30 15:38:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string tools = toolNames[0];
|
2015-09-26 17:05:00 +00:00
|
|
|
toolNames.erase(toolNames.begin());
|
2016-11-30 15:38:31 +00:00
|
|
|
while (toolNames.size() > 1) {
|
|
|
|
tools += ", " + toolNames[0];
|
|
|
|
toolNames.erase(toolNames.begin());
|
|
|
|
}
|
|
|
|
if (toolNames.size() == 1) {
|
|
|
|
tools += " and " + toolNames[0];
|
|
|
|
}
|
|
|
|
autogenComment = "Automatic " + tools + " for target " + target->GetName();
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
|
|
bool usePRE_BUILD = false;
|
|
|
|
cmGlobalGenerator* gg = lg->GetGlobalGenerator();
|
2016-05-16 14:34:04 +00:00
|
|
|
if (gg->GetName().find("Visual Studio") != std::string::npos) {
|
2015-09-26 17:05:00 +00:00
|
|
|
cmGlobalVisualStudioGenerator* vsgg =
|
|
|
|
static_cast<cmGlobalVisualStudioGenerator*>(gg);
|
|
|
|
// Under VS >= 7 use a PRE_BUILD event instead of a separate target to
|
|
|
|
// reduce the number of targets loaded into the IDE.
|
|
|
|
// This also works around a VS 11 bug that may skip updating the target:
|
|
|
|
// https://connect.microsoft.com/VisualStudio/feedback/details/769495
|
|
|
|
usePRE_BUILD = vsgg->GetVersion() >= cmGlobalVisualStudioGenerator::VS7;
|
2016-05-16 14:34:04 +00:00
|
|
|
if (usePRE_BUILD) {
|
2016-11-30 16:47:16 +00:00
|
|
|
// If the autogen target depends on an other target
|
|
|
|
// don't use PRE_BUILD
|
2015-09-26 17:05:00 +00:00
|
|
|
for (std::vector<std::string>::iterator it = depends.begin();
|
2016-05-16 14:34:04 +00:00
|
|
|
it != depends.end(); ++it) {
|
|
|
|
if (!makefile->FindTargetToUse(it->c_str())) {
|
2015-09-26 17:05:00 +00:00
|
|
|
usePRE_BUILD = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
#endif
|
|
|
|
|
2016-12-02 16:21:40 +00:00
|
|
|
if (target->GetPropertyAsBool("AUTORCC")) {
|
|
|
|
cmFilePathChecksum fpathCheckSum(makefile);
|
|
|
|
std::vector<cmSourceFile*> srcFiles;
|
|
|
|
target->GetConfigCommonSourceFiles(srcFiles);
|
|
|
|
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
|
|
|
|
fileIt != srcFiles.end(); ++fileIt) {
|
|
|
|
cmSourceFile* sf = *fileIt;
|
|
|
|
if (sf->GetExtension() == "qrc" &&
|
2016-12-28 11:01:31 +00:00
|
|
|
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOGEN")) &&
|
2016-12-02 16:21:40 +00:00
|
|
|
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) {
|
|
|
|
{
|
|
|
|
const std::string absFile =
|
|
|
|
cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
|
|
|
|
2016-12-02 16:39:59 +00:00
|
|
|
// Run cmake again when .qrc file changes
|
|
|
|
makefile->AddCMakeDependFile(absFile);
|
|
|
|
|
2016-12-02 16:21:40 +00:00
|
|
|
std::string rccOutputFile = autogenBuildDir;
|
|
|
|
rccOutputFile += fpathCheckSum.getPart(absFile);
|
|
|
|
rccOutputFile += "/qrc_";
|
|
|
|
rccOutputFile +=
|
|
|
|
cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile);
|
|
|
|
rccOutputFile += ".cpp";
|
2016-12-02 16:39:59 +00:00
|
|
|
|
|
|
|
// Add rcc output file to origin target sources
|
2016-12-28 11:15:11 +00:00
|
|
|
cmSourceFile* gf = makefile->GetOrCreateSource(rccOutputFile, true);
|
|
|
|
gf->SetProperty("SKIP_AUTOGEN", "On");
|
2016-12-02 16:39:59 +00:00
|
|
|
target->AddSource(rccOutputFile);
|
2016-12-02 16:21:40 +00:00
|
|
|
// Register rcc output file as generated
|
|
|
|
autogenOutputFiles.push_back(rccOutputFile);
|
|
|
|
}
|
|
|
|
if (lg->GetGlobalGenerator()->GetName() == "Ninja"
|
2015-09-26 17:05:00 +00:00
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
2016-12-02 16:21:40 +00:00
|
|
|
|| usePRE_BUILD
|
2015-09-26 17:05:00 +00:00
|
|
|
#endif
|
2016-12-02 16:21:40 +00:00
|
|
|
) {
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
|
2016-11-30 09:13:26 +00:00
|
|
|
RccListInputs(qtMajorVersion, sf, target, depends);
|
2015-09-26 17:05:00 +00:00
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
|
|
// Cannot use PRE_BUILD because the resource files themselves
|
|
|
|
// may not be sources within the target so VS may not know the
|
|
|
|
// target needs to re-build at all.
|
|
|
|
usePRE_BUILD = false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
2016-05-16 14:34:04 +00:00
|
|
|
if (usePRE_BUILD) {
|
2015-09-26 17:05:00 +00:00
|
|
|
// Add the pre-build command directly to bypass the OBJECT_LIBRARY
|
|
|
|
// rejection in cmMakefile::AddCustomCommandToTarget because we know
|
|
|
|
// PRE_BUILD will work for an OBJECT_LIBRARY in this specific case.
|
|
|
|
std::vector<std::string> no_output;
|
|
|
|
std::vector<std::string> no_byproducts;
|
|
|
|
cmCustomCommand cc(makefile, no_output, no_byproducts, depends,
|
|
|
|
commandLines, autogenComment.c_str(),
|
|
|
|
workingDirectory.c_str());
|
|
|
|
cc.SetEscapeOldStyle(false);
|
|
|
|
cc.SetEscapeAllowMakeVars(true);
|
2015-10-05 17:21:30 +00:00
|
|
|
target->Target->AddPreBuildCommand(cc);
|
2016-05-16 14:34:04 +00:00
|
|
|
} else
|
2015-09-26 17:05:00 +00:00
|
|
|
#endif
|
2016-05-16 14:34:04 +00:00
|
|
|
{
|
2015-09-26 17:05:00 +00:00
|
|
|
cmTarget* autogenTarget = makefile->AddUtilityCommand(
|
2016-05-16 14:34:04 +00:00
|
|
|
autogenTargetName, true, workingDirectory.c_str(),
|
2016-12-02 16:20:25 +00:00
|
|
|
/*byproducts=*/autogenOutputFiles, depends, commandLines, false,
|
2016-05-16 14:34:04 +00:00
|
|
|
autogenComment.c_str());
|
2015-09-26 17:05:00 +00:00
|
|
|
|
|
|
|
cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
|
2015-10-18 14:53:00 +00:00
|
|
|
lg->AddGeneratorTarget(gt);
|
2015-09-26 17:05:00 +00:00
|
|
|
|
|
|
|
// Set target folder
|
2016-05-16 14:34:04 +00:00
|
|
|
const char* autogenFolder =
|
|
|
|
makefile->GetState()->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
|
|
|
|
if (!autogenFolder) {
|
|
|
|
autogenFolder =
|
|
|
|
makefile->GetState()->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER");
|
|
|
|
}
|
|
|
|
if (autogenFolder && *autogenFolder) {
|
2015-09-26 17:05:00 +00:00
|
|
|
autogenTarget->SetProperty("FOLDER", autogenFolder);
|
2016-05-16 14:34:04 +00:00
|
|
|
} else {
|
2015-09-26 17:05:00 +00:00
|
|
|
// inherit FOLDER property from target (#13688)
|
2016-11-30 10:12:14 +00:00
|
|
|
utilCopyTargetProperty(gt->Target, target->Target, "FOLDER");
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2015-10-05 17:21:30 +00:00
|
|
|
target->Target->AddUtility(autogenTargetName);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
|
2016-05-16 14:34:04 +00:00
|
|
|
cmGeneratorTarget const* target)
|
2015-09-26 17:05:00 +00:00
|
|
|
{
|
2015-10-05 17:21:30 +00:00
|
|
|
cmMakefile* makefile = target->Target->GetMakefile();
|
2015-09-26 17:05:00 +00:00
|
|
|
|
|
|
|
// forget the variables added here afterwards again:
|
|
|
|
cmMakefile::ScopePushPop varScope(makefile);
|
|
|
|
static_cast<void>(varScope);
|
|
|
|
|
|
|
|
// create a custom target for running generators at buildtime:
|
2016-11-30 12:30:59 +00:00
|
|
|
const std::string autogenTargetName = GetAutogenTargetName(target);
|
2016-12-02 11:10:51 +00:00
|
|
|
const std::string qtMajorVersion = GetQtMajorVersion(target);
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
makefile->AddDefinition(
|
|
|
|
"_moc_target_name",
|
|
|
|
cmOutputConverter::EscapeForCMake(autogenTargetName).c_str());
|
|
|
|
makefile->AddDefinition(
|
|
|
|
"_origin_target_name",
|
|
|
|
cmOutputConverter::EscapeForCMake(target->GetName()).c_str());
|
2016-12-02 11:10:51 +00:00
|
|
|
makefile->AddDefinition("_target_qt_version", qtMajorVersion.c_str());
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2016-12-28 10:56:20 +00:00
|
|
|
std::vector<std::string> mocUicSources;
|
|
|
|
std::vector<std::string> mocUicHeaders;
|
2015-09-26 17:05:00 +00:00
|
|
|
std::vector<std::string> skipMoc;
|
2016-12-28 10:56:20 +00:00
|
|
|
std::vector<std::string> skipUic;
|
2016-11-30 11:17:39 +00:00
|
|
|
std::map<std::string, std::string> configMocIncludes;
|
2016-11-30 11:18:47 +00:00
|
|
|
std::map<std::string, std::string> configMocDefines;
|
2015-09-26 17:05:00 +00:00
|
|
|
std::map<std::string, std::string> configUicOptions;
|
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (target->GetPropertyAsBool("AUTOMOC") ||
|
|
|
|
target->GetPropertyAsBool("AUTOUIC") ||
|
|
|
|
target->GetPropertyAsBool("AUTORCC")) {
|
2016-12-28 10:56:20 +00:00
|
|
|
SetupSourceFiles(target, mocUicSources, mocUicHeaders, skipMoc, skipUic);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
|
|
|
makefile->AddDefinition(
|
2016-12-28 10:56:20 +00:00
|
|
|
"_moc_uic_sources",
|
|
|
|
cmOutputConverter::EscapeForCMake(cmJoin(mocUicSources, ";")).c_str());
|
|
|
|
makefile->AddDefinition(
|
|
|
|
"_moc_uic_headers",
|
|
|
|
cmOutputConverter::EscapeForCMake(cmJoin(mocUicHeaders, ";")).c_str());
|
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (target->GetPropertyAsBool("AUTOMOC")) {
|
2016-12-28 10:56:20 +00:00
|
|
|
MocSetupAutoTarget(target, autogenTargetName, skipMoc, configMocIncludes,
|
|
|
|
configMocDefines);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
|
|
|
if (target->GetPropertyAsBool("AUTOUIC")) {
|
2016-11-30 10:04:58 +00:00
|
|
|
UicSetupAutoTarget(target, skipUic, configUicOptions);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
|
|
|
if (target->GetPropertyAsBool("AUTORCC")) {
|
2016-12-02 11:10:51 +00:00
|
|
|
RccSetupAutoTarget(target, qtMajorVersion);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2016-11-30 12:04:52 +00:00
|
|
|
// Generate config file
|
2016-03-14 14:38:19 +00:00
|
|
|
std::string inputFile = cmSystemTools::GetCMakeRoot();
|
2015-09-26 17:05:00 +00:00
|
|
|
inputFile += "/Modules/AutogenInfo.cmake.in";
|
2016-11-30 11:44:47 +00:00
|
|
|
std::string outputFile = GetAutogenTargetFilesDir(target);
|
2015-09-26 17:05:00 +00:00
|
|
|
outputFile += "/AutogenInfo.cmake";
|
2016-11-30 12:04:52 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(), false, true,
|
|
|
|
false);
|
2015-09-26 17:05:00 +00:00
|
|
|
|
2016-11-30 12:04:52 +00:00
|
|
|
// Append custom definitions to config file
|
|
|
|
if (!configMocDefines.empty() || !configMocIncludes.empty() ||
|
|
|
|
!configUicOptions.empty()) {
|
|
|
|
|
|
|
|
// Ensure we have write permission in case .in was read-only.
|
|
|
|
mode_t perm = 0;
|
2015-09-26 17:05:00 +00:00
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
2016-11-30 12:04:52 +00:00
|
|
|
mode_t mode_write = S_IWRITE;
|
2015-09-26 17:05:00 +00:00
|
|
|
#else
|
2016-11-30 12:04:52 +00:00
|
|
|
mode_t mode_write = S_IWUSR;
|
2015-09-26 17:05:00 +00:00
|
|
|
#endif
|
2016-11-30 12:04:52 +00:00
|
|
|
cmSystemTools::GetPermissions(outputFile, perm);
|
|
|
|
if (!(perm & mode_write)) {
|
|
|
|
cmSystemTools::SetPermissions(outputFile, perm | mode_write);
|
|
|
|
}
|
|
|
|
|
2015-09-26 17:05:00 +00:00
|
|
|
cmsys::ofstream infoFile(outputFile.c_str(), std::ios::app);
|
2016-05-16 14:34:04 +00:00
|
|
|
if (!infoFile) {
|
2015-09-26 17:05:00 +00:00
|
|
|
std::string error = "Internal CMake error when trying to open file: ";
|
2016-05-26 20:52:22 +00:00
|
|
|
error += outputFile;
|
2015-09-26 17:05:00 +00:00
|
|
|
error += " for writing.";
|
|
|
|
cmSystemTools::Error(error.c_str());
|
|
|
|
return;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2016-11-30 11:18:47 +00:00
|
|
|
if (!configMocDefines.empty()) {
|
2015-09-26 17:05:00 +00:00
|
|
|
for (std::map<std::string, std::string>::iterator
|
2016-11-30 11:18:47 +00:00
|
|
|
it = configMocDefines.begin(),
|
|
|
|
end = configMocDefines.end();
|
2016-05-16 14:34:04 +00:00
|
|
|
it != end; ++it) {
|
|
|
|
infoFile << "set(AM_MOC_COMPILE_DEFINITIONS_" << it->first << " "
|
|
|
|
<< it->second << ")\n";
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2016-11-30 11:17:39 +00:00
|
|
|
if (!configMocIncludes.empty()) {
|
2015-09-26 17:05:00 +00:00
|
|
|
for (std::map<std::string, std::string>::iterator
|
2016-11-30 11:17:39 +00:00
|
|
|
it = configMocIncludes.begin(),
|
|
|
|
end = configMocIncludes.end();
|
2016-05-16 14:34:04 +00:00
|
|
|
it != end; ++it) {
|
|
|
|
infoFile << "set(AM_MOC_INCLUDES_" << it->first << " " << it->second
|
|
|
|
<< ")\n";
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
|
|
|
if (!configUicOptions.empty()) {
|
2015-09-26 17:05:00 +00:00
|
|
|
for (std::map<std::string, std::string>::iterator
|
2016-05-16 14:34:04 +00:00
|
|
|
it = configUicOptions.begin(),
|
|
|
|
end = configUicOptions.end();
|
|
|
|
it != end; ++it) {
|
|
|
|
infoFile << "set(AM_UIC_TARGET_OPTIONS_" << it->first << " "
|
|
|
|
<< it->second << ")\n";
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2015-09-26 17:05:00 +00:00
|
|
|
}
|