When integrating into a project that already uses other xcconfig files to change the HEADER_SEARCH_PATHS the pods overrides them even if the pods.xcconfig file is #included from the correct existing xcconfig file. The default behavior should be to always include $(inherited) as with #546
$(inherited) does not work when including xcconfig files, it only works when setting the settings on a ‘higher’ level. (The ‘project level’ as mentioned in the linked to ticket.)
So while I agree that we should probably do this for all settings, it won’t fix your case if you are including xcconfig files into other xcconfig files.
/cc @irrationalfab
@alloy :+1:
We might be talking about two different things, I will explain my entire problem.
After running pod install I reverted what xcconfig file should be used for my project to the one I used before pod install, since cocoapods changed it to Pods.xcconfig. Then I included Pods.xcconfig from my own custom xcconfig. But to get it to compile I had to add $(inherited) to the HEADER_SEARCH_PATHS in the Pods.xcconfig file. If I do that everything works. However every time I run pod install this change is overridden and I have to manually change it again. If however the generator for the Pods.xcconfig included $(inherited) in the HEADER_SEARCH_PATHS everything would work right out of the box.
If we want to make this change I can work on a pull request.
Other related issues: #833 (from #523), #1705, #1736.
This is my fix until cocoapods fixes the issue:
I use post install hook in my Podfile to rewite the Pods.xcconfig file:
post_install do |installer_representation|
workDir = Dir.pwd
xcconfigFilename = "#{workDir}/Pods/Pods.xcconfig"
xcconfig = File.read(xcconfigFilename)
newXcconfig = xcconfig.gsub(/HEADER_SEARCH_PATHS = "/, "HEADER_SEARCH_PATHS = $(inherited) \"")
File.open(xcconfigFilename, "w") { |file| file << newXcconfig }
end
So after running pod install, the header search paths still contain the $(inherited) directive.
For this particular case a CocoaPods patch would be easy.
UPDATE:
Instead of adding the $(inherited) variable it is probably a better approach to add a PODS_ prefix to the Xcode variables in the Pods.xcconfig using the Podfile post_install approach.
Here is my setup of xcconfig files:

You could then include the Pods.xcconfig in your own e.g. Release.xcconfig and add the PODS_ variables to your own search paths.
platform :ios, '6.0'
pod 'AFNetworking', '~> 1.3.3'
pod 'ActionSheetPicker', '~> 0.0.2'
pod 'uservoice-iphone-sdk', '~> 3.0'
pod 'TestFlightSDK', '~> 3.0'
pod 'OpenUDID', '~> 1.0'
pod 'GoogleAnalytics-iOS-SDK', '~> 3.0'
pod 'DDPageControl', '~> 0.1'
pod 'RTLabel', '~> 1.0'
pod 'MCSegmentedControl', '~> 0.0'
pod 'SSKeychain', '~> 1.2'
pod 'SVProgressHUD', '~> 1.0'
pod 'SSZipArchive', '~> 0.3'
pod 'TTTAttributedLabel', '~> 1.8'
pod 'BugSense', '~> 3.6'
post_install do |installer_representation|
workDir = Dir.pwd
xcconfigFilename = "#{workDir}/Pods/Pods.xcconfig"
xcconfig = File.read(xcconfigFilename)
newXcconfig = xcconfig.gsub(/FRAMEWORK_SEARCH_PATHS/, "PODS_FRAMEWORK_SEARCH_PATHS")
newXcconfig = newXcconfig.gsub(/HEADER_SEARCH_PATHS/, "PODS_HEADER_SEARCH_PATHS")
newXcconfig = newXcconfig.gsub(/LIBRARY_SEARCH_PATHS/, "PODS_LIBRARY_SEARCH_PATHS")
newXcconfig = newXcconfig.gsub(/OTHER_LDFLAGS/, "PODS_OTHER_LDFLAGS")
newXcconfig = newXcconfig.gsub(/OTHER_CFLAGS/, "PODS_OTHER_CFLAGS")
File.open(xcconfigFilename, "w") { |file| file << newXcconfig }
end
And here is my Shared.xcconfig which includes the PODS_ variables
#include "../Pods/Pods.xcconfig"
OTHER_LDFLAGS = $(inherited) ${PODS_OTHER_LDFLAGS} -all_load -lstdc++ -ObjC -lz -lxml2 -framework AdSupport -framework CoreTelephony -framework AVFoundation -framework CoreText -framework MobileCoreServices -framework Security -framework CFNetwork -framework CoreMedia -framework MediaPlayer -framework MessageUI -framework QuartzCore -framework StoreKit -framework EventKit -framework AudioToolbox -framework SystemConfiguration -framework Twitter -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -framework ExternalAccessory -framework CoreBluetooth -framework WFConnector
FRAMEWORK_SEARCH_PATHS = $(inherited) ${PODS_FRAMEWORK_SEARCH_PATHS} "$(SOURCE_ROOT)/../vendor/Echo"
HEADER_SEARCH_PATHS = $(inherited) ${PODS_HEADER_SEARCH_PATHS} "$(BUILT_PRODUCTS_DIR)/../../Headers" "$(SOURCE_ROOT)/../RestKit/Build/Headers" "$(SOURCE_ROOT)/../vendor/ios-openssl/include"
LIBRARY_SEARCH_PATHS = $(inherited) ${PODS_LIBRARY_SEARCH_PATHS} "$(SRCROOT)/../vendor/ios-openssl/lib"/**
Closed for duplicating CocoaPods/CocoaPods#833 by @neonichu
Most helpful comment
UPDATE:
Instead of adding the
$(inherited)variable it is probably a better approach to add aPODS_prefix to the Xcode variables in the Pods.xcconfig using the Podfilepost_installapproach.Here is my setup of xcconfig files:
You could then include the Pods.xcconfig in your own e.g. Release.xcconfig and add the PODS_ variables to your own search paths.
And here is my Shared.xcconfig which includes the PODS_ variables