I have project with a macOS Framework and Bundle: The framework is consumed by the app/bundle by embedding it. I also want to create two package: One is the Framework as SDK and one is the App/Bundle with the embedded Framework. I followed the examples in the book “Professional CMake: A Practical Guide” how to create the Framework and Bundle, how to embed it, etc
Without signing everything works a expected: I see two packages created as dmg.
When I enable signing for both (the framework and the bundle) I getting an error
code object is not signed at all
This is what I tried so far.
add_library(MyFwk SHARED ...)
set_target_properties(MyFwk PROPERTIES
FRAMEWORK TRUE
INSTALL_RPATH @loader_path/../../..
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED TRUE
...
)
install(TARGETS MyFwk
EXPORT MyFwkSDK
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FRAMEWORK
DESTINATION "."
COMPONENT sdk
)
add_executable(MyApp MACOSX_BUNDLE ...)
set_target_properties(MyApp PROPERTIES
INSTALL_RPATH @executable_path/../Frameworks
XCODE_ATTRIBUTE_SIGNING_ALLOWED TRUE
XCODE_ATTRIBUTE_SKIP_INSTALL NO
XCODE_EMBED_FRAMEWORKS MyFwk
XCODE_EMBED_FRAMEWORKS_SIGN_ON_COPY TRUE
)
target_link_libraries(MyApp PRIVATE MyFwk)
install(TARGETS MyApp
BUNDLE
DESTINATION "."
COMPONENT app
FRAMEWORK
DESTINATION MyApp.app/Contents/Frameworks
COMPONENT app
)
set(CPACK_GENERATOR DragNDrop)
set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
include(CPack)
I use CMake 3.32.1 and Xcode 12.4 (12D4e).
How do I achieve that both package are signed?