Skip to content

Commit

Permalink
ios: patch project files to support other build dirs - CMake style
Browse files Browse the repository at this point in the history
  • Loading branch information
hjanetzek committed Dec 5, 2018
1 parent e5e1fc6 commit 80e6316
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ endif
@cd platforms/ios && \
jazzy --config jazzy.yml



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

ios-framework: cmake-ios
xcodebuild -workspace platforms/ios/Tangram.xcworkspace -scheme TangramMap -configuration ${BUILD_TYPE} -sdk iphoneos ${XCPRETTY}
Expand Down
25 changes: 23 additions & 2 deletions platforms/ios/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,28 @@ execute_process(COMMAND xcrun --sdk iphoneos --show-sdk-version OUTPUT_VARIABLE

# Configure the API key in the Info.plist for the demo app.
set(NEXTZEN_API_KEY $ENV{NEXTZEN_API_KEY})
configure_file(${PROJECT_SOURCE_DIR}/platforms/ios/demo/Info.plist.in ${PROJECT_BINARY_DIR}/Info.plist)

configure_file(
${PROJECT_SOURCE_DIR}/platforms/ios/demo/Info.plist.in
${PROJECT_BINARY_DIR}/Info.plist)

# Sets ${PROJECT_BINARY_DIR}
configure_file(
${PROJECT_SOURCE_DIR}/platforms/ios/templates/contents.xcworkspacedata
${PROJECT_SOURCE_DIR}/platforms/ios/Tangram.xcworkspace/contents.xcworkspacedata
@ONLY)

# Sets @PROJECT_BINARY_DIR@
configure_file(
${PROJECT_SOURCE_DIR}/platforms/ios/templates/WorkspaceSettings.xcsettings
${PROJECT_SOURCE_DIR}/platforms/ios/Tangram.xcworkspace/xcuserdata/${USER}.xcuserdatad/WorkspaceSettings.xcsettings
@ONLY)

# Sets @PROJECT_BINARY_DIR@
configure_file(
${PROJECT_SOURCE_DIR}/platforms/ios/templates/project.pbxproj
${PROJECT_SOURCE_DIR}/platforms/ios/demo/TangramDemo.xcodeproj/project.pbxproj
@ONLY)

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

### Configure dynamic framework build target.
### Configure dynamic framework build target.

add_library(TangramMap SHARED
${TANGRAM_FRAMEWORK_SOURCES}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CustomBuildLocationType</key>
<string>RelativeToDerivedData</string>
<key>DerivedDataCustomLocation</key>
<string>../../build/ios/DerivedData</string>
<string>@PROJECT_BINARY_DIR@/DerivedData</string>
<key>DerivedDataLocationStyle</key>
<string>WorkspaceRelativePath</string>
<key>EnabledFullIndexStoreVisibility</key>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

/* Begin PBXFileReference section */
D20C4A54212B6D93005BDB9A /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
D222B92321642BCA007E6FD6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../../../build/ios/Info.plist; sourceTree = "<group>"; };
D222B92321642BCA007E6FD6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = @PROJECT_BINARY_DIR@/Info.plist; sourceTree = "<group>"; };
D298721620D05D8E009A0AB8 /* TangramDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TangramDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
D298723020D05F6E009A0AB8 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
D298723120D05F6E009A0AB8 /* MapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapViewController.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -386,12 +386,12 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
INFOPLIST_FILE = ../../../build/ios/Info.plist;
INFOPLIST_FILE = @PROJECT_BINARY_DIR@/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mapzen.ios.TangramDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SYMROOT = ../../../build/ios;
SYMROOT = @PROJECT_BINARY_DIR@;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -403,13 +403,13 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
INFOPLIST_FILE = ../../../build/ios/Info.plist;
INFOPLIST_FILE = @PROJECT_BINARY_DIR@/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.mapzen.ios.TangramDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SYMROOT = ../../../build/ios;
SYMROOT = @PROJECT_BINARY_DIR@;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -420,14 +420,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
HEADER_SEARCH_PATHS = ../../../build/ios/Include;
INFOPLIST_FILE = ../../../build/ios/Info.plist;
HEADER_SEARCH_PATHS = @PROJECT_BINARY_DIR@/Include;
INFOPLIST_FILE = @PROJECT_BINARY_DIR@/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.mapzen.ios.TangramDemo-static";
PRODUCT_NAME = "$(TARGET_NAME)";
SYMROOT = ../../../build/ios;
SYMROOT = @PROJECT_BINARY_DIR@;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -438,14 +438,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
HEADER_SEARCH_PATHS = ../../../build/ios/Include;
INFOPLIST_FILE = ../../../build/ios/Info.plist;
HEADER_SEARCH_PATHS = @PROJECT_BINARY_DIR@/Include;
INFOPLIST_FILE = @PROJECT_BINARY_DIR@/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.mapzen.ios.TangramDemo-static";
PRODUCT_NAME = "$(TARGET_NAME)";
SYMROOT = ../../../build/ios;
SYMROOT = @PROJECT_BINARY_DIR@;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down

0 comments on commit 80e6316

Please sign in to comment.