Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/HomebrewQtInstallProvider.java')
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/HomebrewQtInstallProvider.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/HomebrewQtInstallProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/HomebrewQtInstallProvider.java
new file mode 100644
index 00000000000..d9614222cd8
--- /dev/null
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/HomebrewQtInstallProvider.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2016 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.cdt.internal.qt.core.provider;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.eclipse.cdt.internal.qt.core.QtInstall;
+import org.eclipse.cdt.qt.core.IQtInstall;
+import org.eclipse.cdt.qt.core.IQtInstallProvider;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * QtInstall provider for qt out of Homebrew. Unfortunately they don't put it on the path so we have
+ * to look where they put it.
+ */
+public class HomebrewQtInstallProvider implements IQtInstallProvider {
+
+ @Override
+ public Collection<IQtInstall> getInstalls() {
+ if (Platform.getOS().equals(Platform.OS_MACOSX)) {
+ Path qmakePath = Paths.get("/usr/local/opt/qt5/bin/qmake"); //$NON-NLS-1$
+ if (Files.exists(qmakePath)) {
+ return Arrays.asList(new QtInstall(qmakePath));
+ }
+ }
+ return Collections.emptyList();
+ }
+
+}

Back to the top