Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt VS Tools Property Manager Qt.props file location
Forum Updated to NodeBB v4.3 + New Features

Qt VS Tools Property Manager Qt.props file location

Scheduled Pinned Locked Moved Solved Installation and Deployment
2 Posts 1 Posters 56 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote last edited by
    #1

    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

    1 Reply Last reply
    0
    • PerdrixP Offline
      PerdrixP Offline
      Perdrix
      wrote last edited by
      #2

      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>
      
      1 Reply Last reply
      0
      • PerdrixP Perdrix has marked this topic as solved

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved