View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013784CMakeCMakepublic2012-12-10 21:042016-06-10 14:31
Reportervalentin 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformAppleOSMac OSXOS Version
Product VersionCMake 2.8.5 
Target VersionFixed in Version 
Summary0013784: [OSX] Copy directories as easily as files into the application bundle
DescriptionFirst of all, I apologize for my English :)

I'm here to submit a feature request about the Copy File Phase into the application CFBundle.
Currently, Cmake doc tells us to handle this phase with the set_source_files_properties() command, instead of any other, like the install() command that Xcode didn't properly transcribe.
But if I go on this way, and use the default Makefile generator, copying directories juste create an empty file as use Xcode generator works fine.

Copying directory (with target or source properties) can be useful to copy a framework or an external resource.
 
I suggest just add something like the second line
  std::string copyCommand = "$(CMAKE_COMMAND) -E copy";
  copyCommand += cmSystemTools::FileIsDirectory(input) ? "_directory " : " ";
in the cmMakefileTargetGenerator::WriteMacOSXContentRules function

I understand this more a hack than a conceptual solution, but since the design of this "Copy phase" was initially developed for a file-by-file copy, this is the easier and harmless workaround I see.

The ideal solution would be to port the MACOSX_PACKAGE_LOCATION property on the set_target_properties() command

I apologize if this request was already made or wrote.
Steps To ReproduceCopy a directory with set_property(SOURCE ${DIR} PROPERTY MACOSX_PACKAGE_LOCATION Resources)
and use the Makefile generator.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0031869)
valentin (reporter)
2012-12-11 22:09
edited on: 2012-12-11 22:10

Sorry,
void cmMakefileTargetGenerator::WriteMacOSXContentRules
became
void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator() (cmSourceFile& source, const char* pkgloc)
in 2.8.10.2

and
  std::string copyCommand = "$(CMAKE_COMMAND) -E ";
  copyCommand += cmSystemTools::FileIsDirectory(input) ? "copy_directory " : "copy ";
would be a nicer workaround ;)

(0034265)
tim blechmann (reporter)
2013-10-27 10:57

i'd love to see the same features:
* allow MACOSX_PACKAGE_LOCATION on targets (in order to install build products to an app bundle)
* allow directories as sources, which can then be copied to the bundle
(0037661)
Davy Durham (reporter)
2015-01-11 00:02

I too wish that MACOSX_PACKAGE_LOCATION could be used for copying directories. I have some directories that need to be placed into Resources/. In the meantime I have a hack that uses a POST_BUILD rule to run 'cp -r'
(0042168)
Kitware Robot (administrator)
2016-06-10 14:28

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
2012-12-10 21:04 valentin New Issue
2012-12-11 22:09 valentin Note Added: 0031869
2012-12-11 22:10 valentin Note Edited: 0031869
2013-10-27 10:57 tim blechmann Note Added: 0034265
2015-01-11 00:02 Davy Durham Note Added: 0037661
2016-06-10 14:28 Kitware Robot Note Added: 0042168
2016-06-10 14:28 Kitware Robot Status new => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team