summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-07-26 12:29:44 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-08-05 11:42:22 +0200
commit2b590611991f94ecb464905a638730ba5408659b (patch)
tree9cbaa595ad12b209d7e9c6b1a9210116b0c3e4f8 /Makefile
parenta2e758b4177547fa60155ad8fd5ab5b8f17d6511 (diff)
downloadqtlocation-mapboxgl-2b590611991f94ecb464905a638730ba5408659b.tar.gz
[build] add Xcode project for Qt builds
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 29 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 61cbb5a912..a7b5fe952c 100644
--- a/Makefile
+++ b/Makefile
@@ -319,7 +319,8 @@ endif
#### Qt targets #####################################################
-export QT_OUTPUT_PATH = build/qt-$(BUILD_PLATFORM)-$(BUILD_PLATFORM_VERSION)/$(BUILDTYPE)
+QT_ROOT_PATH = build/qt-$(BUILD_PLATFORM)-$(BUILD_PLATFORM_VERSION)
+export QT_OUTPUT_PATH = $(QT_ROOT_PATH)/$(BUILDTYPE)
QT_BUILD = $(QT_OUTPUT_PATH)/build.ninja
$(QT_BUILD): $(BUILD_DEPS)
@@ -334,6 +335,33 @@ $(QT_BUILD): $(BUILD_DEPS)
-DWITH_CXX11ABI=$(shell scripts/check-cxx11abi.sh) \
-DWITH_COVERAGE=${WITH_COVERAGE})
+ifeq ($(HOST_PLATFORM), macos)
+
+MACOS_QT_PROJ_PATH = $(QT_ROOT_PATH)/xcode/mbgl.xcodeproj
+$(MACOS_QT_PROJ_PATH): $(BUILD_DEPS)
+ mkdir -p $(QT_ROOT_PATH)/xcode
+ (cd $(QT_ROOT_PATH)/xcode && cmake -G Xcode ../../.. \
+ -DBUILD_PLATFORM=$(BUILD_PLATFORM) \
+ -DMBGL_PLATFORM=qt \
+ -DWITH_QT_DECODERS=${WITH_QT_DECODERS} \
+ -DWITH_QT_4=${WITH_QT_4} \
+ -DWITH_CXX11ABI=$(shell scripts/check-cxx11abi.sh) \
+ -DWITH_COVERAGE=${WITH_COVERAGE})
+
+ @# Create Xcode schemes so that we can use xcodebuild from the command line. CMake doesn't
+ @# create these automatically.
+ XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-qt SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
+ XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-qt-qml SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
+ XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-test SCHEME_TYPE=executable platform/macos/scripts/create_scheme.sh
+ XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=mbgl-core SCHEME_TYPE=library BUILDABLE_NAME=libmbgl-core.a BLUEPRINT_NAME=mbgl-core platform/macos/scripts/create_scheme.sh
+ XCODEPROJ=$(MACOS_QT_PROJ_PATH) SCHEME_NAME=qmapboxgl SCHEME_TYPE=library BUILDABLE_NAME=libqmapboxgl.dylib BLUEPRINT_NAME=qmapboxgl platform/macos/scripts/create_scheme.sh
+
+.PHONY: qtproj
+qtproj: $(MACOS_QT_PROJ_PATH)
+ open $(MACOS_QT_PROJ_PATH)
+
+endif
+
.PHONY: qt-app
qt-app: $(QT_BUILD)
$(NINJA) -j$(JOBS) -C $(QT_OUTPUT_PATH) mbgl-qt