Skip to content

Commit 8437c0d

Browse files
committed
ios: patch project files to support other build dirs - CMake style
1 parent e5e1fc6 commit 8437c0d

File tree

5 files changed

+38
-17
lines changed

5 files changed

+38
-17
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ endif
206206
@cd platforms/ios && \
207207
jazzy --config jazzy.yml
208208

209+
210+
209211
# This rule includes steps to copy necessary workspace settings into a user-specific location in the iOS workspace.
210212
# See platforms/ios/DEVELOPING.md for details.
211213
cmake-ios:
212214
cmake -H. -B${IOS_BUILD_DIR} ${IOS_CMAKE_PARAMS}
213-
@mkdir -p platforms/ios/Tangram.xcworkspace/xcuserdata/${USER}.xcuserdatad
214-
@cp platforms/ios/WorkspaceSettings.xcsettings platforms/ios/Tangram.xcworkspace/xcuserdata/${USER}.xcuserdatad/WorkspaceSettings.xcsettings
215215

216216
ios-framework: cmake-ios
217217
xcodebuild -workspace platforms/ios/Tangram.xcworkspace -scheme TangramMap -configuration ${BUILD_TYPE} -sdk iphoneos ${XCPRETTY}

platforms/ios/config.cmake

+23-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,28 @@ execute_process(COMMAND xcrun --sdk iphoneos --show-sdk-version OUTPUT_VARIABLE
1212

1313
# Configure the API key in the Info.plist for the demo app.
1414
set(NEXTZEN_API_KEY $ENV{NEXTZEN_API_KEY})
15-
configure_file(${PROJECT_SOURCE_DIR}/platforms/ios/demo/Info.plist.in ${PROJECT_BINARY_DIR}/Info.plist)
15+
16+
configure_file(
17+
platforms/ios/demo/Info.plist.in
18+
${PROJECT_BINARY_DIR}/Info.plist)
19+
20+
# Sets ${PROJECT_BINARY_DIR}
21+
configure_file(
22+
${PROJECT_SOURCE_DIR}/platforms/ios/templates/contents.xcworkspacedata
23+
${PROJECT_SOURCE_DIR}/platforms/ios/Tangram.xcworkspace/contents.xcworkspacedata
24+
@ONLY)
25+
26+
# Sets @PROJECT_BINARY_DIR@
27+
configure_file(
28+
${PROJECT_SOURCE_DIR}/platforms/ios/templates/WorkspaceSettings.xcsettings
29+
${PROJECT_SOURCE_DIR}/platforms/ios/Tangram.xcworkspace/xcuserdata/${USER}.xcuserdatad/WorkspaceSettings.xcsettings
30+
@ONLY)
31+
32+
# Sets @PROJECT_BINARY_DIR@
33+
configure_file(
34+
${PROJECT_SOURCE_DIR}/platforms/ios/templates/project.pbxproj
35+
${PROJECT_SOURCE_DIR}/platforms/ios/demo/TangramDemo.xcodeproj/project.pbxproj
36+
@ONLY)
1637

1738
# Tell SQLiteCpp to not build its own copy of SQLite, we will use the system library instead.
1839
if (IOS_SDK_VERSION VERSION_LESS 11.0)
@@ -68,7 +89,7 @@ set(TANGRAM_FRAMEWORK_SOURCES
6889
platforms/ios/framework/src/TGURLHandler.mm
6990
)
7091

71-
### Configure dynamic framework build target.
92+
### Configure dynamic framework build target.
7293

7394
add_library(TangramMap SHARED
7495
${TANGRAM_FRAMEWORK_SOURCES}

platforms/ios/WorkspaceSettings.xcsettings platforms/ios/templates/WorkspaceSettings.xcsettings

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CustomBuildLocationType</key>
88
<string>RelativeToDerivedData</string>
99
<key>DerivedDataCustomLocation</key>
10-
<string>../../build/ios/DerivedData</string>
10+
<string>@PROJECT_BINARY_DIR@/DerivedData</string>
1111
<key>DerivedDataLocationStyle</key>
1212
<string>WorkspaceRelativePath</string>
1313
<key>EnabledFullIndexStoreVisibility</key>

platforms/ios/Tangram.xcworkspace/contents.xcworkspacedata platforms/ios/templates/contents.xcworkspacedata

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

platforms/ios/demo/TangramDemo.xcodeproj/project.pbxproj platforms/ios/templates/project.pbxproj

+11-11
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
/* Begin PBXFileReference section */
4848
D20C4A54212B6D93005BDB9A /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
49-
D222B92321642BCA007E6FD6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../../../build/ios/Info.plist; sourceTree = "<group>"; };
49+
D222B92321642BCA007E6FD6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = @PROJECT_BINARY_DIR@/Info.plist; sourceTree = "<group>"; };
5050
D298721620D05D8E009A0AB8 /* TangramDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TangramDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
5151
D298723020D05F6E009A0AB8 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5252
D298723120D05F6E009A0AB8 /* MapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapViewController.m; sourceTree = "<group>"; };
@@ -386,12 +386,12 @@
386386
CODE_SIGN_STYLE = Automatic;
387387
DEVELOPMENT_TEAM = "";
388388
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
389-
INFOPLIST_FILE = ../../../build/ios/Info.plist;
389+
INFOPLIST_FILE = @PROJECT_BINARY_DIR@/Info.plist;
390390
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
391391
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
392392
PRODUCT_BUNDLE_IDENTIFIER = com.mapzen.ios.TangramDemo;
393393
PRODUCT_NAME = "$(TARGET_NAME)";
394-
SYMROOT = ../../../build/ios;
394+
SYMROOT = @PROJECT_BINARY_DIR@;
395395
TARGETED_DEVICE_FAMILY = "1,2";
396396
};
397397
name = Debug;
@@ -403,13 +403,13 @@
403403
CODE_SIGN_STYLE = Automatic;
404404
DEVELOPMENT_TEAM = "";
405405
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
406-
INFOPLIST_FILE = ../../../build/ios/Info.plist;
406+
INFOPLIST_FILE = @PROJECT_BINARY_DIR@/Info.plist;
407407
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
408408
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
409409
ONLY_ACTIVE_ARCH = YES;
410410
PRODUCT_BUNDLE_IDENTIFIER = com.mapzen.ios.TangramDemo;
411411
PRODUCT_NAME = "$(TARGET_NAME)";
412-
SYMROOT = ../../../build/ios;
412+
SYMROOT = @PROJECT_BINARY_DIR@;
413413
TARGETED_DEVICE_FAMILY = "1,2";
414414
};
415415
name = Release;
@@ -420,14 +420,14 @@
420420
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
421421
CODE_SIGN_STYLE = Automatic;
422422
DEVELOPMENT_TEAM = "";
423-
HEADER_SEARCH_PATHS = ../../../build/ios/Include;
424-
INFOPLIST_FILE = ../../../build/ios/Info.plist;
423+
HEADER_SEARCH_PATHS = @PROJECT_BINARY_DIR@/Include;
424+
INFOPLIST_FILE = @PROJECT_BINARY_DIR@/Info.plist;
425425
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
426426
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
427427
OTHER_LDFLAGS = "";
428428
PRODUCT_BUNDLE_IDENTIFIER = "com.mapzen.ios.TangramDemo-static";
429429
PRODUCT_NAME = "$(TARGET_NAME)";
430-
SYMROOT = ../../../build/ios;
430+
SYMROOT = @PROJECT_BINARY_DIR@;
431431
TARGETED_DEVICE_FAMILY = "1,2";
432432
};
433433
name = Debug;
@@ -438,14 +438,14 @@
438438
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
439439
CODE_SIGN_STYLE = Automatic;
440440
DEVELOPMENT_TEAM = "";
441-
HEADER_SEARCH_PATHS = ../../../build/ios/Include;
442-
INFOPLIST_FILE = ../../../build/ios/Info.plist;
441+
HEADER_SEARCH_PATHS = @PROJECT_BINARY_DIR@/Include;
442+
INFOPLIST_FILE = @PROJECT_BINARY_DIR@/Info.plist;
443443
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
444444
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
445445
OTHER_LDFLAGS = "";
446446
PRODUCT_BUNDLE_IDENTIFIER = "com.mapzen.ios.TangramDemo-static";
447447
PRODUCT_NAME = "$(TARGET_NAME)";
448-
SYMROOT = ../../../build/ios;
448+
SYMROOT = @PROJECT_BINARY_DIR@;
449449
TARGETED_DEVICE_FAMILY = "1,2";
450450
};
451451
name = Release;

0 commit comments

Comments
 (0)