# First-class support for modulemap in FRAMEWORK targets

**URL:** <https://discourse.cmake.org/t/first-class-support-for-modulemap-in-framework-targets/11013>\
**Category:** Code\
**Created:** [June 13, 2024, 6:12pm UTC](https://discourse.cmake.org/t/first-class-support-for-modulemap-in-framework-targets/11013 "2024-06-13T18:12:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeM](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/0ea827/32.png) [@JoeM](https://discourse.cmake.org/u/JoeM)\
**Post date:** [June 13, 2024, 6:12pm UTC](https://discourse.cmake.org/t/first-class-support-for-modulemap-in-framework-targets/11013/1 "2024-06-13T18:12:14Z")

</div>

Setting the FRAMEWORK property on a library target builds a framework bundle on Apple platforms. The support for (as example) PUBLIC\_HEADERS generating the `Headers` symlink and similar properties is really nice.

To use the framework with a Swift project, you also need a `Modules/module.modulemap` file to express the umbrella header. Is there a way (property?) to generate this additional file+directory in the resulting framework? Or would this be a new feature request?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [June 13, 2024, 8:35pm UTC](https://discourse.cmake.org/t/first-class-support-for-modulemap-in-framework-targets/11013/2 "2024-06-13T20:35:04Z")

</div>

I believe that is related to Clang modules (a predecessor to C++20 modules)? If so, CMake has no formal modelling for them (nor is it likely we’ll add it given that C++20 modules should cover its cases).

---

<div class="post-metadata">

**Author:** ![JoeM](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/0ea827/32.png) [@JoeM](https://discourse.cmake.org/u/JoeM)\
**Post date:** [June 13, 2024, 9:09pm UTC](https://discourse.cmake.org/t/first-class-support-for-modulemap-in-framework-targets/11013/3 "2024-06-13T21:09:21Z")

</div>

I found out about MACOSX\_PACKAGE\_LOCATION property. I tried setting it but it’s not putting that file in the bundle/framework.

```auto
configure_file(modulemap.in module.modulemap) # set umbrella header name
target_sources(${fw_name} PRIVATE ${CMAKE_BINARY_DIR}/module.modulemap)
set_source_files_properties(${CMAKE_BINARY_DIR}/module.modulemap
  PROPERTIES MACOSX_PACKAGE_LOCATION Modules)

```

The file is not installed though. I don’t see anything from the documentation for MACOSX\_PACKAGE\_LOCATION that I’m missing.

– UPDATE/EDIT –  
It actually is installed, but it’s not linked from the Versions/A/Modules location to the bundle root, like the “known” bundle names (Headers, Private Headers, Resources) are. Looks like you have to manually link the directory.
