Hello,<div><br></div><div>I&#39;m using CMake to build a Mac OS X app, generating an Xcode project. I have two targets, say &quot;projApp&quot; and &quot;projLib&quot;. I&#39;d like for them to be built in such a way that projLib&#39;s output is installed in a subdirectory of projApp&#39;s output folder. I tried this:</div>

<div><br></div><div>set_target_properties(projApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY path/to/somewhere)</div><div>set_target_properties(projLib PROPERTIES LIBRARY_OUTPUT_DIRECTORY path/to/somewhere/lib)</div><div><br></div>

<div>The thing is, Xcode actually puts projApp in path/to/somewhere/[Debug|Release|RelWithDebInfo|MinSizeRel], so that doesn&#39;t work. The configuration that controls this is called &quot;Per-configuration build products path&quot;, or CONFIGURATION_BUILD_DIR, whose default value is $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME).  Then I tried this:</div>

<div><br></div><div>set_target_properties(projApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY path/to/somewhere)</div><div>set_target_properties(projLib PROPERTIES XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR path/to/somewhere/$(CONFIGURATION)/lib)</div>

<div><br></div><div>Which should override CONFIGURATION_BUILD_DIR for projLib, thus putting it in the right directory. However, when I try to open the generated xcodeproj, Xcode says it can&#39;t parse the file and refuses to open the project. Investigating further, it seems that any use of a $(VAR) macro in an Xcode attribute renders the .xcodeproj unparsable.</div>

<div><br></div><div>Does anyone have any experience doing this? Is there perhaps an easier way to achieve what I want?</div><div><br></div><div>Thanks,</div><div><br></div><div>Pedro</div>