diff options
author | Brad King <brad.king@kitware.com> | 2014-04-21 13:32:27 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-04-21 13:32:27 (GMT) |
commit | 464c8ab3a27fdf323a2607ee9389a79466648643 (patch) | |
tree | d3df38026c772d990aee22fc5259cf9f4f3f1273 /Source | |
parent | fd4ee2d86f4a2c5d1e3b4296aacec9b0f375dfc5 (diff) | |
parent | 33774ca2018666138e5d31dde457643357f33815 (diff) | |
download | CMake-464c8ab3a27fdf323a2607ee9389a79466648643.zip CMake-464c8ab3a27fdf323a2607ee9389a79466648643.tar.gz CMake-464c8ab3a27fdf323a2607ee9389a79466648643.tar.bz2 |
Merge topic 'autorcc-target-dir'
33774ca2 QtAutogen: Put generated qrc files in a target-specific dir.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 12 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.h | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index ae11462..cc6932d 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -367,6 +367,8 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target) makefile->AddDefinition("_moc_target_name", cmLocalGenerator::EscapeForCMake(autogenTargetName).c_str()); + makefile->AddDefinition("_origin_target_name", + cmLocalGenerator::EscapeForCMake(target->GetName()).c_str()); std::string targetDir = getAutogenTargetDir(target); @@ -506,7 +508,9 @@ void cmQtAutoGenerators::SetupSourceFiles(cmTarget const* target) std::string basename = cmsys::SystemTools:: GetFilenameWithoutLastExtension(absFile); - std::string rcc_output_file = makefile->GetCurrentOutputDirectory(); + std::string rcc_output_dir = target->GetSupportDirectory(); + cmSystemTools::MakeDirectory(rcc_output_dir.c_str()); + std::string rcc_output_file = rcc_output_dir; rcc_output_file += "/qrc_" + basename + ".cpp"; makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", rcc_output_file.c_str(), false); @@ -1063,6 +1067,8 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile, this->ProjectBinaryDir = makefile->GetSafeDefinition("AM_CMAKE_BINARY_DIR"); this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR"); this->TargetName = makefile->GetSafeDefinition("AM_TARGET_NAME"); + this->OriginTargetName + = makefile->GetSafeDefinition("AM_ORIGIN_TARGET_NAME"); { const char *uicOptionsFiles @@ -2057,7 +2063,9 @@ bool cmQtAutoGenerators::GenerateQrc() std::string basename = cmsys::SystemTools:: GetFilenameWithoutLastExtension(*si); - std::string rcc_output_file = this->Builddir + "qrc_" + basename + ".cpp"; + std::string rcc_output_file = this->Builddir + + "CMakeFiles/" + this->OriginTargetName + + ".dir/qrc_" + basename + ".cpp"; int sourceNewerThanQrc = 0; bool success = cmsys::SystemTools::FileTimeCompare(si->c_str(), diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 8003795..501e13a 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -104,6 +104,7 @@ private: std::string ProjectBinaryDir; std::string ProjectSourceDir; std::string TargetName; + std::string OriginTargetName; std::string CurrentCompileSettingsStr; std::string OldCompileSettingsStr; |