'Xcode 12 duplicated source code in project

I'm moving a Linux based GitHub repo over to MAC OSX to make a bundle.

I have set up Xcode (12) and created a project following this guide:

https://acecilia.medium.com/setup-a-c-c-makefile-project-in-xcode-syntax-highlight-autocompletion-jump-to-definition-and-80405bd4542e

The guide shows how to clone a repo from GitHub and then drag-n-drop it into an Xcode project.

My repo is cloned at ~/Projects/OVCC My Xcode project is at ~/Projects/ExtTst/ExtTst

After dragging the git repo in the project I have a second set of code at:

~/Projects/ExtTst/ExtTst/OVCC

This seems to work until I try to make changes to the source files.

After I make a change and rebuild the change appears not to have occurred.

Looking in the project there appears to be two copies of the code as shown in here:

Xcode Project

To overcome this I changed the External Build Tool Configure directory from:

/Users/tcs/Projects/OVCC (as recommended in the guide)

to:

/Users/tcs/Projects/ExtTst/ExtTst/OVCC

Now this seems to build but creates all the objects back in :

/Users/tcs/Projects/OVCC

Instead!!!

So it picks up the source from one location and creates the output in the other!!!

I obviously don't have my Xcode project setup correctly but I'm not sure what to fix.

What do I change to fix this or is there a better way to setup the project to begin with?

The repo builds fine from a terminal but I would like to use Xcode to build bundle.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source