The red message "INSTALL TARGETS - target Xxx has RESOURCE files but no RESOURCE DESTINATION." is misleading on Apple platforms.
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When building an OS X application, the resource files are listed in the RESOURCE target property. Following INSTALL(...) documentation:
The PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE arguments cause subsequent properties to be applied to installing a FRAMEWORK shared library target’s associated files on non-Apple platforms. Rules defined by these arguments are ignored on Apple platforms because the associated files are installed into the appropriate locations inside the framework folder.
From the documentation, one would understand that there is no point in giving a RESOURCE argument to INSTALL command when targeting Apple platforms: the argument is ignored, and the resource are copied inside the bundle (the second statement here being actually true). Yet, if this argument is omitted, a red message is emitted in the GUI, which seems confusing with regard to the documentation statement.
Also, if one decides to provide this argument with a dummy location to turn off the message, the install target will actually copy the RESOURCE files to the dummy location (So the argument is not ignored: the resources are still copied in the bundle, but they are also copied in the provided location).
Steps to reproduce:
##
## This is the skeleton of a CMakeLists.txt that would trigger the red message when generated on Apple
##
# populate ${${PROJECT_NAME}_RESOURCES} variable with a .xib file and images
add_executable(${PROJECT_NAME} MACOSX_BUNDLE
${${PROJECT_NAME}_HEADERS}
${${PROJECT_NAME}_SOURCES}
${${PROJECT_NAME}_RESOURCES}
main.mm
)
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION "${VERSION}"
SOVERSION "${SOVERSION}"
RESOURCE "${${PROJECT_NAME}_RESOURCES}"
)
install(TARGETS ${PROJECT_NAME}
BUNDLE DESTINATION ${RUNTIME_OUTPUT_DIRECTORY}
)