Have Premake generate a vcxproj file that refers to an existing .props file

435 Views Asked by At

I am using a third party SDK that supplies a .props file that is used in the visual studio projects.

I generate my .vcxproj file with Premake, as opposed to using the SDK's project wizard.

How can I tell Premake to generate the vcxproj file in such a way that it adds references to the third party .props file?

Currently, Premake adds to my vcxproj file:

  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>

Yet, I want it to be like this instead:

  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="ACME_SDK.props" Condition="exists('ACME_SDK.props')" />
  </ImportGroup>

So one additional Import tag.

1

There are 1 best solutions below

0
On BEST ANSWER

There is no built in way afaik

you could look into overriding the propertySheets function

p.override(premake.vstudio.vc2010, 'propertySheets',  customPropertySheets)

where customPropertySheets is your function where you need to call the base function and add whatever else you need.