Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add the Copy Bundle Resources phase with CMake in Xcode?

Tags:

xcode

ios

cmake

I have a CMake (3.12.2) project that generates an iOS Xcode project. And I managed to configure almost everything I need via CMake, except one thing: the Copy Bundle Resources phase.

I can't find any info on how to do this, though this is a common task. And I can't just leave it and add this phase manually every time I re-generate my project.

What to do? Did I miss something obvious?

like image 950
mr.dog Avatar asked Sep 12 '25 20:09

mr.dog


1 Answers

set(png_path "${YOUR_PNG_DIR}/test.png")

target_sources(${TARGET} PUBLIC ${png_path})

set_source_files_properties(${png_path} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

YOUR_PNG_DIR can be a cmake macro

like image 162
tenos Avatar answered Sep 14 '25 10:09

tenos