View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015676CMakeCMakepublic2015-08-03 05:332016-06-10 14:31
ReporterAdn 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformAppleOSOS XOS Version10.9
Product VersionCMake 3.3 
Target VersionFixed in Version 
Summary0015676: The red message "INSTALL TARGETS - target Xxx has RESOURCE files but no RESOURCE DESTINATION." is misleading on Apple platforms.
DescriptionWhen building an OS X application, the resource files are listed in the RESOURCE target property. Following INSTALL(...) documentation (http://www.cmake.org/cmake/help/v3.3/command/install.html?highlight=install#installing-targets [^]):

>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}
)
Additional InformationThere is a stack overflow question on this topic:
http://stackoverflow.com/q/31723271/1027706 [^]
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0042815)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-08-03 05:33 Adn New Issue
2016-06-10 14:29 Kitware Robot Note Added: 0042815
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team