[CMake] MACOSX_PACKAGE_LOCATION Not Working?

Marek Vojtko (Firaxis) Marek.Vojtko at firaxis.com
Tue May 7 18:14:20 EDT 2013


Hi,

I am trying to copy assets (textures) into an application bundle in my project's CMake file. The solution that has brought me the closest was the following:

// ${ASSETS_DIR} points to a directory in my project that contains the textures
file( GLOB Textures "${ASSETS_DIR}/*.dds" )
file( GLOB Sources "*.cpp" "*.h" )

set_property( SOURCE ${Textures} PROPERTY MACOSX_PACKAGE_LOCATION "Assets" )

add_executable( "MyProject" MACOSX_BUNDLE ${Sources} ${Textures} )

set_target_properties( "MyProject" PROPERTIES RESOURCE "${Textures}" )

This gets me as far as having all my textures in the application bundle, but it seems to ignore the MACOSX_PACKAGE_LOCATION because the textures end up in the same (root) directory as the executable and not the in specified "Assets" directory.

Am I missing something or doing something wrong? Is there a way to have CMake copy my textures into the application bundle in a specific directory?

Thanks,
--
Marek Vojtko
mail: marek.vojtko at firaxis.com
phone: (+1) 410-229-2519


More information about the CMake mailing list