@@ -16,7 +16,12 @@ if(NOT IOS)
1616 return ()
1717endif ()
1818
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+ )
2025
2126# Copy build files to trigger pod install as it requires a valid Xcode project
2227file (
@@ -44,11 +49,6 @@ execute_process(
4449
4550message ("${pods_output} " )
4651
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- )
5252
5353
5454# Sets up a target to have the correct dependencie on the install pods target
@@ -87,24 +87,38 @@ endfunction()
8787# include paths are expecting the header files to be in a subdirectory, when
8888# accessing the header files directly does not have them in the same structure.
8989#
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+ # )
9193#
9294# Args:
9395# target_name: Name of target to add includes to
9496# pod_name: Name of the pod in the Podfile
9597# 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
9699#
97100function (symlink_pod_headers target_name pod_name dir_name)
98101
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+
99113 set (gen_file ${CMAKE_CURRENT_BINARY_DIR} /pod_sym_links/gen_${dir_name} .txt)
100114 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" )
102116
103117 file (GLOB framework_dir ${glob_dir} )
104118
105119 # If failed to find headers, try again one folder up
106120 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" )
108122 file (GLOB framework_dir ${glob_dir} )
109123 endif ()
110124
0 commit comments