Setting Installation Directory correctly is a mystery

Hello I'm wrapping my head around on how to properly set up xcode project to produce a static library ending up in file locations /usr/local/lib/libXXX.a and /usr/local/include/XXX/xxx.h so it can be used Unix style in other projects.

If I put under Deployment Deployment Location: YES Installation Build Products Location: / Installation Directory: /usr/local/lib Skip Install: NO

I get errors like

warning: Stale file '/usr/local/usr/local/include/xxx.h' is located outside of the allowed root paths.

and things like

error: Cycle inside a single target; building could produce unreliable results.

Installation Build Products Location: /usr/local/lib Installation Directory: /

I get

warning: Stale file '/usr/local/include/xxx.h' is located outside of the allowed root paths.

but the library file is not put into /usr/local/lib (note /usr/local/lib and /usr/local/include are owned by my user and writeable)

I could write an old style Makefile and have xcode call the makefile but there must be an easier way to do this.

This is for a cross platform development so having it packaged into a Framework would not solve it neither.

Hello I'm wrapping my head around on how to properly set up xcode project to produce a static library

Why?

file locations /usr/local/lib/libXXX.a and /usr/local/include/XXX/xxx.h so it can be used Unix style in other projects

That's not really the way that macOS works.

I could write an old style Makefile and have xcode call the makefile but there must be an easier way to do this.

What's wrong with a makefile? Xcode is designed to build iOS apps. There is no "easy" way to make it build open-source style archives and headers. And why should there be? Any open source project would be using standard tools to do this kind of thing. They would never, ever use Xcode.

This is for a cross platform development so having it packaged into a Framework would not solve it neither.

The Mac and Xcode are not useful for cross-platform development. Just use whatever standard tools fit your technical and social requirements - autotools, CMake, Google-build-engine-du-jour, whatever.

Now if you wanted to build an app with any of those open-source projects, then porting it all to Xcode can be a very good idea. That makes many problems vanish. But if you're trying to go the other way, you're just inventing new problems.

Pro tip: recent versions of Xcode allow you to statically link frameworks, with a few caveats.

Setting Installation Directory correctly is a mystery
 
 
Q