Ash
Ash

Reputation: 2294

Add Xcode build phase via CMake

I've tried searching for a solution to this issue but can't seem to find anything.

I need to add the 'Copy Bundle Resources' build phase using CMake. It can be added through Xcode itself as shown below: enter image description here

But I need to do this via CMake.

Upvotes: 6

Views: 3213

Answers (1)

Alf
Alf

Reputation: 812

Use MACOSX_PACKAGE_LOCATION. Here is an example:

file(GLOB XIB_FILES *.xib)
set_source_files_properties(${XIB_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

And don't forget to add ${XIB_FILES} to the list of your add_executable as in:

add_executable(MyApp MACOSX_BUNDLE ${XIB_FILES} ...)

Upvotes: 8

Related Questions