[cmake-developers] [CMake 0015676]: The red message "INSTALL TARGETS - target Xxx has RESOURCE files but no RESOURCE DESTINATION." is misleading on Apple platforms.

Mantis Bug Tracker mantis at public.kitware.com
Mon Aug 3 05:33:41 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15676 
====================================================================== 
Reported By:                Adn
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15676
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-08-03 05:33 EDT
Last Modified:              2015-08-03 05:33 EDT
====================================================================== 
Summary:                    The red message "INSTALL TARGETS - target Xxx has
RESOURCE files but no RESOURCE DESTINATION." is misleading on Apple platforms.
Description: 
When 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 Information: 
There is a stack overflow question on this topic:
http://stackoverflow.com/q/31723271/1027706
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-08-03 05:33 Adn            New Issue                                    
======================================================================



More information about the cmake-developers mailing list