Page MenuHomePhabricator

Error in usFunctionEmbedResources.cmake
Closed, ResolvedPublic

Description

I use usFunctionEmbedResources() in an external project and end up in the function's last add_custom_command() call. This call is meant to create a post build command that makes the resource compiler append a zip file to a library:

add_custom_command(
  TARGET ${US_RESOURCE_TARGET}
  POST_BUILD
  COMMAND ${resource_compiler} --append $<TARGET_FILE:${US_RESOURCE_TARGET}> ${US_RESOURCE_MODULE_NAME} ${_zip_archive}
  WORKING_DIRECTORY ${US_RESOURCE_WORKING_DIRECTORY}
  COMMENT "Appending zipped resources to ${US_RESOURCE_TARGET}"
  VERBATIM
)

The problem is that the command syntax is wrong and causes the resource compiler to stop and print its usage. The resource compiler, when called with "--append" does not expect the module name. The working version skips this parameter:

add_custom_command(
  TARGET ${US_RESOURCE_TARGET}
  POST_BUILD
  COMMAND ${resource_compiler} --append $<TARGET_FILE:${US_RESOURCE_TARGET}> ${_zip_archive}
  WORKING_DIRECTORY ${US_RESOURCE_WORKING_DIRECTORY}
  COMMENT "Appending zipped resources to ${US_RESOURCE_TARGET}"
  VERBATIM
)

Whereas I am not sure if this needs a Needs_Core_Modification flag, I'd rather let you know about this change.

Event Timeline

User maleike has pushed new remote branch:

bug-19562-usFunctionEmbedResources

Maybe there's a difference in the command syntax on different plattforms?

(In reply to Stefan Kislinskiy from comment #2)

Maybe there's a difference in the command syntax on different plattforms?

Good point, that may be a reason. I did not check the sources of the resource compiler yet. Tested it on Windows 7 64bit.

The resource compiler cmd line is platform independent. This really looks like a bug to me.

Removing the parameter as suggested is the right way to go. I suspect that the macro was never called in this way before so we didn't hit that bug until now.

The master isn't locked anymore, you can merge. Thank you! :)

[302c9c]: Merge branch 'bug-19562-usFunctionEmbedResources'

Merged commits:

2016-02-17 10:49:45 Daniel Maleike [b38eb9]
Fix rcc compiler call