提交 fb628449 编写于 作者: L Levi Armstrong 提交者: GitHub

Fix code blocks file locator (#74)

Fix issue #73 
上级 d65b186f
......@@ -339,10 +339,20 @@ ROSUtils::PackageInfoMap ROSUtils::getWorkspacePackageInfo(const WorkspaceInfo &
package.name = it.key();
package.path = it.value();
package.filepath = Utils::FileName::fromString(package.path).appendPath("package.xml");
package.buildInfo.cbpFile = Utils::FileName(workspaceInfo.buildPath).appendPath(package.name).appendPath(QString("%1.cbp").arg(package.name));
if (package.buildInfo.exists())
// Get packages build directory
QString pkgBuildPath = package.path;
pkgBuildPath.replace(workspaceInfo.sourcePath.toString(), workspaceInfo.buildPath.toString());
package.buildInfo.path = Utils::FileName::fromString(pkgBuildPath);
// Get package's code block file
QDir pkgBuildDir(pkgBuildPath);
QStringList cbpFilter("*.cbp");
QStringList pkgCbpFiles = pkgBuildDir.entryList(cbpFilter);
if (!pkgCbpFiles.isEmpty())
{
package.buildInfo.cbpFile = Utils::FileName::fromString(pkgBuildPath).appendPath(pkgCbpFiles.first());
if (ROSUtils::getPackageBuildInfo(workspaceInfo, package))
{
wsPackageInfo.insert(package.name, package);
......@@ -474,7 +484,7 @@ bool ROSUtils::getPackageBuildInfo(const WorkspaceInfo &workspaceInfo, ROSUtils:
PackageTargetInfo targetInfo;
targetInfo.name = targetName;
targetInfo.type = targetType;
targetInfo.flagsFile = Utils::FileName(workspaceInfo.buildPath).appendPath(package.name).appendPath("CMakeFiles").appendPath(QString("%1.dir").arg(targetName)).appendPath("flags.make");
targetInfo.flagsFile = Utils::FileName(package.buildInfo.path).appendPath("CMakeFiles").appendPath(QString("%1.dir").arg(targetName)).appendPath("flags.make");
// The order matters so it will order local first then system
targetInfo.includes = targetLocalIncludes;
......
......@@ -80,6 +80,7 @@ public:
/** @brief Contains a packages relavent build informations */
struct PackageBuildInfo {
Utils::FileName path; /**< @brief Path to the Package's build directory */
Utils::FileName cbpFile; /**< @brief Path to the Package's CodeBlocks file */
PackageTargetInfoList targets; /**< @brief List of packages target's */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册