Permalink
Browse files

compute relative path from source root for the PODS_ROOT var

  • Loading branch information...
1 parent 8b194ec commit bdd9d1b71710841d26125728d71689baaf2080ed @subdigital committed Feb 24, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/cocoapods/installer/target_installer.rb
@@ -10,10 +10,16 @@ def initialize(podfile, project, definition)
@podfile, @project, @definition = podfile, project, definition
end
+ def pods_path_relative_to_project
+ pods_path = Pathname.new(config.project_pods_root)
+ source_path = Pathname.new(config.source_root)
+ Pathname.new(pods_path).relative_path_from(source_path)
+ end
+
def xcconfig
@xcconfig ||= Xcodeproj::Config.new({
# In a workspace this is where the static library headers should be found.
- 'PODS_ROOT' => '$(SRCROOT)/Pods',
+ 'PODS_ROOT' => "$(SRCROOT)/#{pods_path_relative_to_project}",
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers"',
'ALWAYS_SEARCH_USER_PATHS' => 'YES', # needed to make EmbedReader build
# This makes categories from static libraries work, which many libraries

0 comments on commit bdd9d1b

Please sign in to comment.