summaryrefslogtreecommitdiff
path: root/qpid/packaging/windows/installer.proj
blob: de68b056260a7036e9ce8660374c1e007d304b45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
-->

<!--
 Packaging script for Apache Qpid on Windows

 Builds the C++ and WCF components, and packages those along with user
 documentation and the python pieces needed to generate QMF stuff.
-->

<Project DefaultTargets="Clean;Installer"
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <PropertyGroup>
	<build_dir>$(MSBuildProjectDirectory)\build</build_dir>
	<source_root>$(MSBuildProjectDirectory)\..\..</source_root>
	<staging_dir>$(MSBuildProjectDirectory)\stage</staging_dir>
	<bits Condition="'$(bits)' == ''">32</bits>
	<OutputName>qpidc</OutputName>
	<OutputType>Package</OutputType>
	<WixToolPath>C:\Program Files (x86)\Windows Installer XML v3.5\bin</WixToolPath>
        <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.5\wix.targets</WixTargetsPath>
    </PropertyGroup>

    <Choose>
        <When Condition="'$(bits)' == '64'">
	    <PropertyGroup>
	        <ProgramFiles>ProgramFiles64Folder</ProgramFiles>
		<CmakeGenerator>%22Visual Studio 9 2008 Win64%22</CmakeGenerator>
		<Architecture>x64</Architecture>
		<CSProjArchitecture>x64</CSProjArchitecture>
	    </PropertyGroup>
	</When>
	<Otherwise>
	    <PropertyGroup>
	        <ProgramFiles>ProgramFilesFolder</ProgramFiles>
		<CmakeGenerator>%22Visual Studio 9 2008%22</CmakeGenerator>
		<Architecture>x86</Architecture>
		<CSProjArchitecture>Win32</CSProjArchitecture>
    </PropertyGroup>
	</Otherwise>
    </Choose>

    <ItemGroup>
	<CppDebugProjects Include="$(build_dir)\src\qpidcommon.vcproj"/>
	<CppDebugProjects Include="$(build_dir)\src\qpidclient.vcproj"/>
	<CppDebugProjects Include="$(build_dir)\src\qmfconsole.vcproj"/>
    </ItemGroup>

    <ItemGroup>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qpidcommond.dll"/>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qpidcommond.lib"/>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qpidcommond.pdb"/>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qpidclientd.dll"/>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qpidclientd.lib"/>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qpidclientd.pdb"/>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qmfconsoled.dll"/>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qmfconsoled.lib"/>
	<CppDebugArtifacts Include="$(build_dir)\src\Debug\qmfconsoled.pdb"/>
    </ItemGroup>

    <ItemGroup>
	<WcfProjects Include="$(source_root)\wcf\src\Apache\Qpid\**\*.csproj"/>
	<WcfArtifacts Include="$(source_root)\wcf\src\Apache\Qpid\Channel\bin\Release\*.dll"/>
	<WcfExamples Include="$(source_root)\wcf\samples\**\*"
	             Exclude="$(source_root)\wcf\samples\**\.svn\**"/>
    </ItemGroup>

    <ItemGroup>
        <BoostDlls Include="$(staging_dir)\bin\boost_*.dll"/>
    </ItemGroup>

    <ItemGroup>
        <WixExtension Include="WixUtilExtension">
            <HintPath>$(WixToolPath)\WixUtilExtension.dll</HintPath>
        </WixExtension>
        <WixExtension Include="WixUIExtension">
            <HintPath>$(WixToolPath)\WixUIExtension.dll</HintPath>
        </WixExtension>
    </ItemGroup>
    <Import Project="$(WixTargetsPath)" />


    <Target Name="Clean">
    	<RemoveDir
            Directories="$(build_dir);$(staging_dir)" />
    </Target>

    <Target Name="MakeBuildDirs">
    	<MakeDir
            Directories="$(build_dir);$(staging_dir)" />
    </Target>

    <Target Name="Configure" DependsOnTargets="MakeBuildDirs">
        <Message Text="build: $(build_dir)"/>
        <Message Text="stage: $(staging_dir)"/>
    	<Exec
	    Command="cmake -G $(CmakeGenerator) -DCMAKE_INSTALL_PREFIX=$(staging_dir) $(cmake_options) $(source_root)\cpp"
	    WorkingDirectory="$(build_dir)" />
    </Target>

    <Target Name="BuildCpp" DependsOnTargets="Configure">
        <!-- Using VCBuild here with a set of vcproj files misses the
             dependencies, so use devenv to pick up everything. -->
	<!-- Need to ignore the exit code until QMF engine builds clean -->
	<Exec
	    Command="devenv qpid-cpp.sln /build Release /Project ALL_BUILD"
	    WorkingDirectory="$(build_dir)"
	    IgnoreExitCode="true" />
    </Target>

    <Target Name="BuildCppDebug" DependsOnTargets="Configure">
    	<VCBuild
	    Projects="@(CppDebugProjects)"
	    SolutionFile="$(build_dir)/qpid-cpp.sln"
	    Configuration="Debug" />
    </Target>

    <!-- StopOnFirstFailure needed to avoid a weird error trying to compile WIN32 -->
    <Target Name="BuildWcf" DependsOnTargets="BuildCpp">
        <MSBuild
	    Projects="$(source_root)\wcf\QpidWcf.sln"
	    Properties="Configuration=Release;Platform=$(CSProjArchitecture)"
	    StopOnFirstFailure="false" />
    </Target>

    <Target Name="BuildDocs" DependsOnTargets="Configure">
    	<VCBuild
	    Projects="$(build_dir)\docs\api\user-api-docs.vcproj"
	    SolutionFile="$(build_dir)/qpid-cpp.sln"
	    Configuration="Release" />
    </Target>

    <Target Name="Stage"
            DependsOnTargets="BuildCpp;BuildCppDebug;BuildWcf;BuildDocs">
        <Exec
	    Command="cmake -DCMAKE_INSTALL_CONFIG_NAME=%22Release%22 -P $(build_dir)\cmake_install.cmake" />
    	<Copy
	    SourceFiles="@(CppDebugArtifacts)"
	    DestinationFolder="$(staging_dir)\bin" />
    	<Copy
	    SourceFiles="@(WcfArtifacts)"
	    DestinationFolder="$(staging_dir)\bin" />
	<Copy
	    SourceFiles="@(WcfExamples)"
	    DestinationFiles="@(WcfExamples->'$(staging_dir)\examples\%(RecursiveDir)%(Filename)%(Extension)')" />
    </Target>

    <Target Name="Installer" DependsOnTargets="Stage">
    <!-- Would be nice to use the WiX Tasks but I'm getting what I think are
         errors mixing 32- and 64-bit artifacts.
    	<HeatDirectory
	    ToolPath="$(WixToolPath)"
	    Directory="$(staging_dir)\include\boost"
	    ComponentGroupName="group_BoostHeaders"
	    OutputFile="boost_headers.wxs" />
	<HeatFile
	    ToolPath="$(WixToolPath)"
	    File="@(BoostDlls)"
	    ComponentGroupName="group_BoostDlls"
	    DirectoryRefId="QpidBin"
	    OutputFile="boost_dlls.wxs" />
	<Candle
	    ToolPath="$(WixToolPath)"
	    DefineConstants="qpidc_version=0.6"
	    InstallerPlatform="x64"
	    OutputFile="qpidc-0.6-x64.msi" />
    -->
        <Exec
	    Command="heat dir $(staging_dir)\include\qpid -var var.qpid_headers_dir -dr QpidInclude -gg -cg group_QpidHeaders -out qpid_headers.wxs" />
        <Exec
	    Command="heat dir $(staging_dir)\include\boost -var var.boost_headers_dir -dr QpidInclude -gg -cg group_BoostHeaders -out boost_headers.wxs" />
	<!-- HEAT5150 warns about self-registering DLLs; don't care -->
	<Exec
	    Command="heat dir $(staging_dir)\bin\boost -var var.boost_dll_dir -dr QpidBin -srd -gg -cg group_BoostDlls -sw5150 -out boost_dlls.wxs" />
	<Exec
	    Command="heat dir $(staging_dir)\examples -var var.examples_dir -dr INSTALLLOCATION -gg -cg group_Examples -out examples.wxs" />
	<Exec
	    Command="heat dir $(staging_dir)\docs\api  -var var.api_docs_dir -dr QpidDoc -gg -cg group_APIDocs -out api_docs.wxs" />
	<Exec
	    Command="candle -dqpidc_version=0.6 -dProgramFiles=$(ProgramFiles) -dstaging_dir=$(staging_dir) -dqpid_headers_dir=$(staging_dir)\include\qpid -dboost_headers_dir=$(staging_dir)\include\boost -dboost_dll_dir=$(staging_dir)\bin\boost -dexamples_dir=$(staging_dir)\examples -dapi_docs_dir=$(staging_dir)\docs\api qpidc.wxs qpid_headers.wxs boost_headers.wxs boost_dlls.wxs examples.wxs api_docs.wxs -arch $(Architecture)" />
	<Exec
	    Command="light -ext WixUtilExtension -ext WixUIExtension -cultures:en-us -out qpidc-0.6-$(Architecture).msi qpidc.wixobj qpid_headers.wixobj boost_headers.wixobj boost_dlls.wixobj examples.wixobj api_docs.wixobj" />
    </Target>

</Project>