mipadi
mipadi

Reputation: 411012

Can Xcode insert the version number into a library's filename when building?

If I am building a dynamic library called Awesome, Xcode outputs the built product as libAwesome.dylib. Is there a way to have Xcode insert the filename, so it gets built as libAwesome.1.0.0.dylib?

Upvotes: 3

Views: 2617

Answers (1)

crimson_penguin
crimson_penguin

Reputation: 2778

Set your Product Name to Awesome.${DYLIB_CURRENT_VERSION}.

DYLIB_CURRENT_VERSION is set by Current Library Version in the build settings.

Oh, and to see a list of all such environment variables, just make a new Run Script Build Phase, leave it empty, but check the "Show environment variables in build log" box, and then build. If you show the log for that build phase, it'll show all the environment variables along with their values. And then you can use them in the same way as above.

Upvotes: 9

Related Questions