Add Xcode build phase via CMake

I tried to find a solution to this problem, but I can not 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 through CMake.

+4
source share
1 answer

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 your add_executable list, as in:

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

+3
source

All Articles