@@ -16,7 +16,12 @@ if(NOT IOS)
16
16
return ()
17
17
endif ()
18
18
19
- set (FIREBASE_POD_DIR ${CMAKE_CURRENT_BINARY_DIR} )
19
+ # Add these two vars to the cache to make them avaliable in global scope
20
+ set (FIREBASE_POD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "" )
21
+ set (FIREBASE_POD_HEADER_DIR
22
+ "${FIREBASE_POD_DIR} /Pods/Headers/Public"
23
+ CACHE STRING ""
24
+ )
20
25
21
26
# Copy build files to trigger pod install as it requires a valid Xcode project
22
27
file (
@@ -44,11 +49,6 @@ execute_process(
44
49
45
50
message ("${pods_output} " )
46
51
47
- set (FIREBASE_POD_DIR ${FIREBASE_POD_DIR} PARENT_SCOPE )
48
- set (FIREBASE_POD_HEADER_DIR
49
- "${CMAKE_CURRENT_BINARY_DIR} /Pods/Headers/Public"
50
- PARENT_SCOPE
51
- )
52
52
53
53
54
54
# Sets up a target to have the correct dependencie on the install pods target
@@ -87,24 +87,38 @@ endfunction()
87
87
# include paths are expecting the header files to be in a subdirectory, when
88
88
# accessing the header files directly does not have them in the same structure.
89
89
#
90
- # Usage: symlink_pod_headers(<target_name> <pod_name> <dir_name>)
90
+ # Usage: symlink_pod_headers(<target_name> <pod_name> <dir_name>
91
+ # [FRAMEWORK_DIR_NAME <framework_dir>]
92
+ # )
91
93
#
92
94
# Args:
93
95
# target_name: Name of target to add includes to
94
96
# pod_name: Name of the pod in the Podfile
95
97
# dir_name: Name of the dir for the symlink (most cases should be same as pod_name)
98
+ # framework_dir: Set if pod uses a different folder name for frameworks
96
99
#
97
100
function (symlink_pod_headers target_name pod_name dir_name )
98
101
102
+ set (multi OUTPUT_NAME FRAMEWORK_DIR_NAME )
103
+
104
+ # Parse the arguments into SYMLINK_POD_FRAMEWORK_DIR_NAME.
105
+ cmake_parse_arguments (SYMLINK_POD "" "" "${multi} " ${ARGN} )
106
+
107
+ set (FRAMEWORK_DIR "Frameworks" )
108
+
109
+ if (NOT "${SYMLINK_POD_FRAMEWORK_DIR_NAME} " STREQUAL "" )
110
+ set (FRAMEWORK_DIR "${SYMLINK_POD_FRAMEWORK_DIR_NAME} " )
111
+ endif ()
112
+
99
113
set (gen_file ${CMAKE_CURRENT_BINARY_DIR} /pod_sym_links/gen_${dir_name}.txt )
100
114
set (symlink_dir ${CMAKE_CURRENT_BINARY_DIR} /pod_sym_links/${dir_name} )
101
- set (glob_dir "${FIREBASE_POD_DIR} /Pods/${pod_name} /Frameworks /*/*.framework/Headers" )
115
+ set (glob_dir "${FIREBASE_POD_DIR} /Pods/${pod_name} /${FRAMEWORK_DIR} /*/*.framework/Headers" )
102
116
103
117
file (GLOB framework_dir ${glob_dir} )
104
118
105
119
# If failed to find headers, try again one folder up
106
120
if (NOT EXISTS ${framework_dir} )
107
- set (glob_dir "${FIREBASE_POD_DIR} /Pods/${pod_name} /Frameworks /*.framework/Headers" )
121
+ set (glob_dir "${FIREBASE_POD_DIR} /Pods/${pod_name} /${FRAMEWORK_DIR} /*.framework/Headers" )
108
122
file (GLOB framework_dir ${glob_dir} )
109
123
endif ()
110
124
0 commit comments