Merge topic 'AddAutomocTargetFolder'

ba0e06f automoc: add a global AUTOMOC_TARGETS_FOLDER property
This commit is contained in:
Brad King 2013-07-01 09:22:22 -04:00 committed by CMake Topic Stage
commit 5f36fa98ff
3 changed files with 23 additions and 3 deletions

View File

@ -255,8 +255,18 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
automocTargetName.c_str(), true,
workingDirectory.c_str(), depends,
commandLines, false, automocComment.c_str());
// inherit FOLDER property from target (#13688)
copyTargetProperty(automocTarget, target, "FOLDER");
// Set target folder
const char* automocFolder = makefile->GetCMakeInstance()->GetProperty(
"AUTOMOC_TARGETS_FOLDER");
if (automocFolder && *automocFolder)
{
automocTarget->SetProperty("FOLDER", automocFolder);
}
else
{
// inherit FOLDER property from target (#13688)
copyTargetProperty(automocTarget, target, "FOLDER");
}
target->AddUtility(automocTargetName.c_str());
}

View File

@ -236,7 +236,9 @@ void cmTarget::DefineProperties(cmake *cm)
"AUTOMOC_MOC_OPTIONS property.\n"
"By setting the CMAKE_AUTOMOC_RELAXED_MODE variable to TRUE the rules "
"for searching the files which will be processed by moc can be relaxed. "
"See the documentation for this variable for more details.");
"See the documentation for this variable for more details.\n"
"The global property AUTOMOC_TARGETS_FOLDER can be used to group the "
"automoc targets together in an IDE, e.g. in MSVS.");
cm->DefineProperty
("AUTOMOC_MOC_OPTIONS", cmProperty::TARGET,

View File

@ -3602,6 +3602,14 @@ void cmake::DefineProperties(cmake *cm)
"property to name those folders. See also the documentation "
"for the FOLDER target property.");
cm->DefineProperty
("AUTOMOC_TARGETS_FOLDER", cmProperty::GLOBAL,
"Name of FOLDER for *_automoc targets that are added automatically by "
"CMake for targets for which AUTOMOC is enabled.",
"If not set, CMake uses the FOLDER property of the parent target as a "
"default value for this property. See also the documentation for the "
"FOLDER target property and the AUTOMOC target property.");
cm->DefineProperty
("PREDEFINED_TARGETS_FOLDER", cmProperty::GLOBAL,
"Name of FOLDER for targets that are added automatically by CMake.",