Allow TARGET_BUNDLE_DIR for imported targets
!635 (merged) introduced the TARGET_BUNDLE_DIR
generator expression.
For some reason it was decided to disallow usage for imported targets. Trying to use it for an imported target will result in a
TARGET_BUNDLE_DIR not allowed for IMPORTED targets.
error.
Is there a technical reason for why this decision happened?
Or could it be made to work for imported targets?
What I'm trying to achieve, is to copy an imported framework into an application bundle without defining a separate variable:
# ...
find_package(mylib REQUIRED)
target_link_libraries(myapp PRIVATE mylib::mylib)
target_sources(myapp PRIVATE $<TARGET_BUNDLE_DIR:mylib>)
set_source_files_properties($<TARGET_BUNDLE_DIR:mylib> PROPERTIES
MACOSX_PACKAGE_LOCATION Frameworks
XCODE_FILE_ATTRIBUTES "CodeSignOnCopy"
)
set_target_properties(myapp PROPERTIES
INSTALL_RPATH "@executable_path/Frameworks"
BUILD_WITH_INSTALL_RPATH TRUE
)
Edited by Martin Buchner