How to change output directory for a target

Kuldeep Kapade picture Kuldeep Kapade · Jun 15, 2012 · Viewed 63.4k times · Source

I am using a workspace where I have a main app project and then a static library project which is used by the main app. I want static library project to spit out libX.a into the main app project directory, because i want to push this libX.a into my Git repo.

The changing of build path settings for static lib project should be pushed to its own git repo so other don't have to deal with this change again and again.

I tried changing 'Build Products Path' to "$(SRCROOT)/../SharedData" for mt static lib target but it doesn't have any effect.

Thanks!

Answer

Jeff Sternberg picture Jeff Sternberg · Jul 25, 2012
  1. Go to File -> Project Settings.

  2. Click the Advanced button under Derived Data Location. Under build location select custom and choose your output directory. This will change the variable $(BUILD_DIR) to whatever you set in that field.

  3. Click done and go to your target settings. Under Build Location you can now specify where the targets are output based on that $(BUILD_DIR) macro.