premake-core
premake-core copied to clipboard
How to set "Item Type" property to "Copy file"?
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.

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.
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++?
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
Hmm, looking at the documentation of Premake, it makes it sound like those are only available for C# projects.
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.
