forked from qt-creator/qt-creator
CMake: Fine tune finding a suitable targets for files
Ignore targets that have no include directories, those are in general not targets that are very useful. Change-Id: I1cd1f7dffc73eace2f7a0897bc15dea7e6bc5fee Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -874,6 +874,8 @@ void CMakeCbpParser::sortFiles()
|
||||
int bestIncludeCount = -1;
|
||||
for (int i = 0; i < m_buildTargets.size(); ++i) {
|
||||
const CMakeBuildTarget &target = m_buildTargets.at(i);
|
||||
if (target.includeFiles.isEmpty())
|
||||
continue;
|
||||
if (target.sourceDirectory == m_sourceDirectory
|
||||
&& target.includeFiles.count() > bestIncludeCount) {
|
||||
bestIncludeCount = target.includeFiles.count();
|
||||
@@ -893,6 +895,8 @@ void CMakeCbpParser::sortFiles()
|
||||
|
||||
for (int i = 0; i < m_buildTargets.size(); ++i) {
|
||||
const CMakeBuildTarget &target = m_buildTargets.at(i);
|
||||
if (target.includeFiles.isEmpty())
|
||||
continue;
|
||||
if (fileName.isChildOf(Utils::FileName::fromString(target.sourceDirectory)) &&
|
||||
(target.sourceDirectory.size() > bestLength ||
|
||||
(target.sourceDirectory.size() == bestLength &&
|
||||
|
||||
Reference in New Issue
Block a user