# Using asset catalogs for macOS/iOS projects

**URL:** https://discourse.cmake.org/t/using-asset-catalogs-for-macos-ios-projects/1588
**Category:** Usage
**Tags:** os:macos, os:ios
**Created:** [July 19, 2020, 11:49am UTC](https://discourse.cmake.org/t/using-asset-catalogs-for-macos-ios-projects/1588 "2020-07-19T11:49:31Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [July 19, 2020, 9:18pm UTC](https://discourse.cmake.org/t/using-asset-catalogs-for-macos-ios-projects/1588/2 "2020-07-19T21:18:13Z")

</div>

Rather than adding each part of the asset catalog individually, see if adding it as a whole directory works instead:

```cmake
target_sources(${TARGETNAME} PRIVATE Assets.xcassets)
set_source_files_properties(Assets.xcassets PROPERTIES
    MACOSX_PACKAGE_LOCATION Resources
)

```

Adding directories rather than files is not officially supported by CMake as far as I’m aware, but doing it this way should allow Xcode to see the asset catalog and compile it for you. I don’t recall if setting the source file properties is required or not, but give it a go and see.

---

_[View the full topic](https://discourse.cmake.org/t/using-asset-catalogs-for-macos-ios-projects/1588)._
