[CMake] copy targets into bundles

Stephan Diederich stephan.diederich at googlemail.com
Sat Nov 22 13:00:04 EST 2008


Hi,

I've a CMakeLists.txt which creates two executable tagets. One of them
is a bundle, the other a command-line utility. Now I want to have (at
best during build) the helper utility copied into the Resources folder
of the bundle. I could not find a straightforward way of doing this.

With source files this works out of the box:
add_executable(MyBundle MACOSX_BUNDLE main.mm test.xml)
set_source_files_properties(test.xml PROPERTIES MACOSX_PACKAGE_LOCATION
  Resources)

But how to do it with cmake targets?

The pretty much stripped down version of my CMakeLists.txt:
add_executable(helperapp main.cpp)
add_executable(MyBundle MACOSX_BUNDLE main.mm)
#do something to copy helperapp to MyBundle.app/Contents/Resources

Thanks for any pointers,
Stephan


More information about the CMake mailing list