Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Xcode build phase via CMake

Tags:

xcode

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.

like image 993
Ash Avatar asked May 25 '15 03:05

Ash


1 Answers

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} ...)

like image 90
Alf Avatar answered Sep 19 '22 02:09

Alf