Qt VS Tools Property Manager Qt.props file location
-
I needed to change the configuration of Qt VS Tools a bit in Visual Studio, nothing major, I just needed to configure things so that the QTDIR variable was exported as an environment variable for the build. So I used the "Property Manager" and edited the user macros to do this.
This created a file in C:\Users\amonra\AppData\Local\QtMsBuild called Qt.props:
<!-- /////////////////////////////////////////////////////////////////////////////////////////////////// // Item type definition and default values // --> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////// // Import private Qt property definitions // --> <ImportGroup Label="Qt"> <Import Project="$(MSBuildThisFileDirectory)\qt_private.props" /> </ImportGroup> <!-- ///////////////////////////////////////////////////////////////////////////////////////////////// // User-defined settings // --> <PropertyGroup Label="UserMacros"> <!-- Placeholder for user macros written by VS Property Manager --> </PropertyGroup> <PropertyGroup> <!-- Placeholder for properties written by VS Property Manager --> </PropertyGroup> <ItemDefinitionGroup> <!-- Placeholder for default metadata written by VS Property Manager --> </ItemDefinitionGroup> <ItemGroup> <!-- Placeholder for items written by VS Property Manager --> <BuildMacro Include="QTDIR"> <Value>$(QTDIR)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> </ItemGroup> </Project>
which is great and works for ME, but is no use for other users of the project - I need this to be held in the Solution directory, so it can be checked into the VCS (Github).
Is there a way to do this that can be stored in the solution directory as a .props file?
Thanks
Dave -
Solution found, I edited the vcpkg.props file with gets loaded after Qt so that it sets the environment variable:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ImportGroup Label="PropertySheets" /> <PropertyGroup Label="UserMacros"> <VCPKG_KEEP_ENV_VARS>QTDIR</VCPKG_KEEP_ENV_VARS> <QTDIR>$(QtInstallDir)</QTDIR> </PropertyGroup> <PropertyGroup /> <ItemDefinitionGroup /> <ItemGroup> <BuildMacro Include="VCPKG_KEEP_ENV_VARS"> <Value>$(VCPKG_KEEP_ENV_VARS)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> <BuildMacro Include="QTDIR"> <Value>$(QTDIR)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> </ItemGroup> </Project>
-
P Perdrix has marked this topic as solved