premake-core icon indicating copy to clipboard operation
premake-core copied to clipboard

How to set "Item Type" property to "Copy file"?

Open mfloriani opened this issue 4 years ago • 5 comments

Hey,

Can I set the Item Type property of a file in the project to Copy file using premake? I'm using VS2019 with a C++17 project.

image

mfloriani avatar Jul 29 '21 10:07 mfloriani

You would use buildaction for that.

filter { 'files:**.txt' }
   buildaction 'Copy'

This might not be supported for all exporters yet, but pretty sure it should work with VS 2019.

starkos avatar Aug 01 '21 13:08 starkos

You would use buildaction for that.

filter { 'files:**.txt' }
   buildaction 'Copy'

This might not be supported for all exporters yet, but pretty sure it should work with VS 2019.

Is there somewhere that can be looked at to find all actions for C++?

nickclark2016 avatar Aug 03 '21 16:08 nickclark2016

Is there somewhere that can be looked at to find all actions for C++?

There does not seem to be. Here's everything I was able to find in sources…

  • Embed
  • Compile
  • Copy
  • Component
  • Form
  • UserControl
  • Resource
  • Application
  • FxCompile
  • None

starkos avatar Aug 10 '21 10:08 starkos

Hmm, looking at the documentation of Premake, it makes it sound like those are only available for C# projects.

nickclark2016 avatar Aug 10 '21 11:08 nickclark2016

Correct, those are the C# values. The C++ values are the element names and they're not validated. So, instead of Compile like C#, it's ClCompile for C++. Handling C++ that way was probably a mistake, and maybe we should consider mapping the C# values to C++ - everyone seems to get confused by the documentation anyway. image

samsinsane avatar Aug 10 '21 14:08 samsinsane