summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-03-22 15:42:35 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-03-23 16:09:07 +0200
commit1c757cce34344dfecc9a724034680225143f92b7 (patch)
tree2115ed73b715f166f219b6a0b306b64d206f81ac /Makefile
parenta3f40d0c0c906400439eeb25d50f39eac64327ef (diff)
downloadqtlocation-mapboxgl-1c757cce34344dfecc9a724034680225143f92b7.tar.gz
[build] Autodetect Qt{4,5}
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 12 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 0edfe685a2..2eb2728b8a 100644
--- a/Makefile
+++ b/Makefile
@@ -361,20 +361,23 @@ endif
#### Qt targets #####################################################
-ifeq ($(WITH_QT_4), 1)
-QT_ROOT_PATH = build/qt4-$(BUILD_PLATFORM)-$(BUILD_PLATFORM_VERSION)
-else
-QT_ROOT_PATH = build/qt-$(BUILD_PLATFORM)-$(BUILD_PLATFORM_VERSION)
-endif
-
-ifneq (,$(shell which qmake))
-export QT_INSTALL_DOCS = $(shell qmake -query QT_INSTALL_DOCS)
+QT_QMAKE_FOUND := $(shell command -v qmake 2> /dev/null)
+ifdef QT_QMAKE_FOUND
+ export QT_INSTALL_DOCS = $(shell qmake -query QT_INSTALL_DOCS)
+ ifeq ($(shell qmake -query QT_VERSION | head -c1), 4)
+ QT_ROOT_PATH = build/qt4-$(BUILD_PLATFORM)-$(BUILD_PLATFORM_VERSION)
+ WITH_QT_4=1
+ else
+ QT_ROOT_PATH = build/qt-$(BUILD_PLATFORM)-$(BUILD_PLATFORM_VERSION)
+ WITH_QT_4=0
+ endif
endif
export QT_OUTPUT_PATH = $(QT_ROOT_PATH)/$(BUILDTYPE)
QT_BUILD = $(QT_OUTPUT_PATH)/build.ninja
$(QT_BUILD): $(BUILD_DEPS)
+ @scripts/check-qt.sh
mkdir -p $(QT_OUTPUT_PATH)
(cd $(QT_OUTPUT_PATH) && cmake -G Ninja ../../.. \
-DCMAKE_BUILD_TYPE=$(BUILDTYPE) \
@@ -392,6 +395,7 @@ ifeq ($(HOST_PLATFORM), macos)
MACOS_QT_PROJ_PATH = $(QT_ROOT_PATH)/xcode/mbgl.xcodeproj
$(MACOS_QT_PROJ_PATH): $(BUILD_DEPS)
+ @scripts/check-qt.sh
mkdir -p $(QT_ROOT_PATH)/xcode
(cd $(QT_ROOT_PATH)/xcode && cmake -G Xcode ../../.. \
-DMBGL_PLATFORM=qt \