Skip to content

Commit

Permalink
Add QtMsBuild to the project as there are some platforms where it is …
Browse files Browse the repository at this point in the history
…not available. Specially on Windows Visual Studip + Qt addn
  • Loading branch information
AIRLegend committed Jul 30, 2020
1 parent a4efb84 commit f536ee8
Show file tree
Hide file tree
Showing 39 changed files with 9,484 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Client/Client.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{5B4F6644-3599-41DB-8A3C-4CD888FCC86B}</ProjectGuid>
<Keyword>QtVS_v303</Keyword>
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
<QtMsBuild Condition="'$(SolutionDir)\QtMsBuild'=='' OR !Exists('$(SolutionDir)\QtMsBuild\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
<ProjectName>Client</ProjectName>
<RootNamespace>Client</RootNamespace>
</PropertyGroup>
Expand All @@ -40,7 +40,7 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(SolutionDir)\QtMsBuild\qt.targets') or !Exists('$(SolutionDir)\QtMsBuild\qt.props')">
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
</Target>
<ImportGroup Label="ExtensionSettings" />
Expand All @@ -55,8 +55,8 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
<Import Project="$(QtMsBuild)\qt_defaults.props" />
<ImportGroup Condition="Exists('$(SolutionDir)\QtMsBuild\qt_defaults.props')">
<Import Project="$(SolutionDir)\QtMsBuild\qt_defaults.props" />
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<LinkIncremental>true</LinkIncremental>
Expand Down Expand Up @@ -109,7 +109,7 @@
</ProjectReference>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
<QtInstall>5.9.9</QtInstall>
<QtInstall>$(QTDIR)</QtInstall>
<QtModules>core;uitools;widgets;quick</QtModules>
<QtBuildConfig>debug</QtBuildConfig>
<QtLibrarySearchPath>$(QTDIR)\lib;$(QtLibrarySearchPath)</QtLibrarySearchPath>
Expand All @@ -127,8 +127,8 @@
<QtModules>core;uitools;widgets;quick</QtModules>
<QtBuildConfig>release</QtBuildConfig>
</PropertyGroup>
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">
<Import Project="$(QtMsBuild)\qt.props" />
<ImportGroup Condition="Exists('$(SolutionDir)\QtMsBuild\qt.props')">
<Import Project="$(SolutionDir)\QtMsBuild\qt.props" />
</ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
<ClCompile>
Expand Down Expand Up @@ -218,8 +218,8 @@
<Image Include="res\logo_256px.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" />
<ImportGroup Condition="Exists('$(SolutionDir)\QtMsBuild\qt.targets')">
<Import Project="$(SolutionDir)\QtMsBuild\qt.targets" />
</ImportGroup>
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
46 changes: 46 additions & 0 deletions QtMsBuild/deploy/qt_import.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt VS Tools.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
// Qt/MSBuild import
// -->
<PropertyGroup>
<QtMsBuildProps>
$(QtMsBuildProps);
$(MSBuildThisFileDirectory)qtdeploy.props
</QtMsBuildProps>
<QtMsBuildTargets>
$(QtMsBuildTargets);
$(MSBuildThisFileDirectory)qtdeploy.targets
</QtMsBuildTargets>
</PropertyGroup>
</Project>
40 changes: 40 additions & 0 deletions QtMsBuild/deploy/qtdeploy.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt VS Tools.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-->

<!--
///////////////////////////////////////////////////////////////////////////////////////////////////
// Deployment of Qt dependencies
// -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<QtDeploy Condition="'$(QtDeploy)' == ''">false</QtDeploy>
</PropertyGroup>
</Project>
77 changes: 77 additions & 0 deletions QtMsBuild/deploy/qtdeploy.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt VS Tools.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-->

<!--
///////////////////////////////////////////////////////////////////////////////////////////////////
// Deployment of Qt dependencies
// -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
// Deploy Qt files
// -->
<Target Name="QtDeploy"
AfterTargets="Link"
DependsOnTargets="QtRunDeploy"
Condition="'$(QtDeploy)' == 'true'">
<ReadLinesFromFile File="$(TargetName).windeployqt.$(Platform).$(Configuration)">
<Output TaskParameter="Lines" ItemName="DeploymentItems" />
</ReadLinesFromFile>
<ItemGroup>
<None Include="@(DeploymentItems)">
<DeploymentContent>true</DeploymentContent>
<RootFolder>$(ProjectDir)</RootFolder>
</None>
</ItemGroup>
</Target>

<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
// Call windeployqt
// -->
<Target Name="QtRunDeploy"
Inputs="$(OutDir)\$(TargetName).exe"
Outputs="$(TargetName).windeployqt.$(Platform).$(Configuration)"
Condition="'$(QtDeploy)' == 'true'">
<PropertyGroup>
<Cmd>$(QTDIR)\bin\windeployqt.exe</Cmd>
<Cmd>$(Cmd) -qmldir "$(MSBuildProjectDirectory)"</Cmd>
<Cmd>$(Cmd) -list relative</Cmd>
<Cmd>$(Cmd) -dir "$(MSBuildProjectDirectory)"</Cmd>
<Cmd>$(Cmd) "$(OutDir)\$(TargetName).exe"</Cmd>
<Cmd>$(Cmd) > "$(TargetName).windeployqt.$(Platform).$(Configuration)"</Cmd>
</PropertyGroup>
<Message Importance="high" Text="windeployqt: $(Cmd)" />
<Exec Command="$(Cmd)" />
</Target>

</Project>
46 changes: 46 additions & 0 deletions QtMsBuild/moc/qt_import.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt VS Tools.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
// Qt/MSBuild import
// -->
<PropertyGroup>
<QtMsBuildProps>
$(QtMsBuildProps);
$(MSBuildThisFileDirectory)qtmoc.props
</QtMsBuildProps>
<QtMsBuildTargets>
$(QtMsBuildTargets);
$(MSBuildThisFileDirectory)qtmoc.targets
</QtMsBuildTargets>
</PropertyGroup>
</Project>
83 changes: 83 additions & 0 deletions QtMsBuild/moc/qtmoc.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt VS Tools.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-->
<!--
///////////////////////////////////////////////////////////////////////////////////////////////////
// Qt/MSBuild moc property definitions
// -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
// Import pre-requisites
// -->
<Import
Condition="'$(QtMsBuildProps_BeforeMoc)' != ''"
Project="$(QtMsBuildProps_BeforeMoc)"/>

<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
// QtMoc item template
// -->
<ItemDefinitionGroup>
<QtMoc>
<ExecutionDescription>moc %(Identity)</ExecutionDescription>

<QTDIR Condition="'$(QtVsProjectSettings)' != 'true'"
>$(QTDIR)</QTDIR>
<QTDIR Condition="'$(QtVsProjectSettings)' == 'true'"
>$(QtInstallDir)</QTDIR>

<InputFile>%(FullPath)</InputFile>

<OutputFile Condition="'$(QtVsProjectSettings)' != 'true'"
>$(ProjectDir)GeneratedFiles\$(Configuration)\moc_%(Filename).cpp</OutputFile>

<QtMocDir Condition="'$(QtVsProjectSettings)' == 'true'"
>$(IntDir)moc\</QtMocDir>
<QtMocFileName Condition="'$(QtVsProjectSettings)' == 'true'"
>moc_%(Filename).cpp</QtMocFileName>

<DynamicSource>output</DynamicSource>
<ParallelProcess>true</ParallelProcess>
<CommandLineTemplate>[AllOptions] [AdditionalOptions]</CommandLineTemplate>
<Outputs>%(OutputFile)</Outputs>
<OverrideClCompile>false</OverrideClCompile>
</QtMoc>
</ItemDefinitionGroup>

<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
// Import dependants
// -->
<Import
Condition="'$(QtMsBuildProps_AfterMoc)' != ''"
Project="$(QtMsBuildProps_AfterMoc)"/>

</Project>
Loading

0 comments on commit f536ee8

Please sign in to comment.