[gtk+/gtk-2-24] Visual Studio builds: Generate .pc files



commit 7e5d11f9d48164c4e89ecd7c000bca8d76fa117a
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Nov 15 17:10:08 2016 +0800

    Visual Studio builds: Generate .pc files
    
    Like the 3.x and 4.x builds, generate the .pc files for GTK+-2.x, for
    the convenience of people, and copy them during "install".

 build/win32/vs10/Makefile.am                       |    1 +
 build/win32/vs10/gtk-install.propsin               |   18 ++++++++
 build/win32/vs10/gtk-install.vcxproj               |   26 +++++++++--
 build/win32/vs10/gtk-install.vcxproj.filters       |   13 ++++++
 ...sion-paths.props => gtk-version-paths.props.in} |   14 ++++++
 build/win32/vs11/Makefile.am                       |    3 +-
 build/win32/vs12/Makefile.am                       |    3 +-
 build/win32/vs14/Makefile.am                       |    3 +-
 build/win32/vs9/gtk-install.vcproj                 |   46 ++++++++++++++++++--
 build/win32/vs9/gtk-install.vspropsin              |   14 ++++++
 ...-paths.vsprops => gtk-version-paths.vsprops.in} |   13 ++++++
 configure.ac                                       |    2 +
 12 files changed, 145 insertions(+), 11 deletions(-)
---
diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am
index 34876f4..25f2289 100644
--- a/build/win32/vs10/Makefile.am
+++ b/build/win32/vs10/Makefile.am
@@ -37,6 +37,7 @@ EXTRA_DIST += \
        gtk-update-icon-cache.vcxproj   \
        gtk-update-icon-cache.vcxproj.filters   \
        gtk-install.vcxproj     \
+       gtk-install.vcxproj.filters     \
        $(GENERATED_ITEMS)
 
 MSVC_INTERMEDIATE_FILES = gdk-win32.vs10.headers gdk.vs10.headers gtk.vs10.headers gailutil.vs10.headers
diff --git a/build/win32/vs10/gtk-install.propsin b/build/win32/vs10/gtk-install.propsin
index cf1a95a..910218c 100644
--- a/build/win32/vs10/gtk-install.propsin
+++ b/build/win32/vs10/gtk-install.propsin
@@ -60,7 +60,16 @@ mkdir $(CopyDir)\share\themes\Raleigh\gtk-2.0
 copy ..\..\..\gtk\gtkrc.default $(CopyDir)\share\themes\Raleigh\gtk-2.0\gtkrc
 
 if exist $(CopyDir)\share\icons\hicolor $(CopyDir)\bin\gtk-update-icon-cache.exe --ignore-theme-index 
--force "$(CopyDir)\share\icons\hicolor"
+
+mkdir $(CopyDir)\lib\pkgconfig
+copy ..\gdk-2.0.pc $(CopyDir)\lib\pkgconfig
+copy ..\gdk-2.0.pc $(CopyDir)\lib\pkgconfig\gdk-win32-2.0.pc
+copy "..\gtk+-2.0.pc" "$(CopyDir)\lib\pkgconfig"
+copy "..\gtk+-2.0.pc" "$(CopyDir)\lib\pkgconfig\gtk+-win32-2.0.pc"
 </GtkDoInstall>
+    <GenerateGtkPC>$(PythonPath)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) 
--host=i686-pc-vs$(VSVer)</GenerateGtkPC>
+    <GenerateGtkPCX64>$(PythonPathX64)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) 
--host=x86_64-pc-vs$(VSVer)</GenerateGtkPCX64>
+    
<GtkPCFiles>$(SolutionDir)\..\gdk-2.0.pc;$(SolutionDir)\..\gtk+-2.0.pc;$(SolutionDir)\..\gail.pc</GtkPCFiles>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>gtkinstallprops</_PropertySheetDisplayName>
@@ -78,5 +87,14 @@ if exist $(CopyDir)\share\icons\hicolor $(CopyDir)\bin\gtk-update-icon-cache.exe
     <BuildMacro Include="GtkDoInstall">
       <Value>$(GtkDoInstall)</Value>
     </BuildMacro>
+    <BuildMacro Include="GenerateGtkPC">
+      <Value>$(GenerateGtkPC)</Value>
+    </BuildMacro>
+    <BuildMacro Include="GenerateGtkPCX64">
+      <Value>$(GenerateGtkPCX64)</Value>
+    </BuildMacro>
+    <BuildMacro Include="GtkPCFiles">
+      <Value>$(GtkPCFiles)</Value>
+    </BuildMacro>
   </ItemGroup>
 </Project>
diff --git a/build/win32/vs10/gtk-install.vcxproj b/build/win32/vs10/gtk-install.vcxproj
index bcd0775..e90fcfb 100644
--- a/build/win32/vs10/gtk-install.vcxproj
+++ b/build/win32/vs10/gtk-install.vcxproj
@@ -88,16 +88,34 @@
     <CustomBuild Include="..\..\..\config.h.win32">
       <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Installing Build 
Results...</Message>
       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GtkDoInstall)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">blah;%(Outputs)</Outputs>
+      <AdditionalInputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GtkPCFiles)</AdditionalInputs>
       <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Installing Build Results...</Message>
       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GtkDoInstall)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">blah;%(Outputs)</Outputs>
+      <AdditionalInputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GtkPCFiles)</AdditionalInputs>
       <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Installing Build 
Results...</Message>
       <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GtkDoInstall)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">blah;%(Outputs)</Outputs>
+      <AdditionalInputs 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GtkPCFiles)</AdditionalInputs>
       <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Installing Build 
Results...</Message>
       <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GtkDoInstall)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">blah;%(Outputs)</Outputs>
+      <AdditionalInputs 
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GtkPCFiles)</AdditionalInputs>
+    </CustomBuild>
+    <CustomBuild Include="..\gtkpc.py">
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating .pc files...</Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GenerateGtkPC)</Command>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GtkPCFiles);%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating .pc files...</Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GenerateGtkPC)</Command>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GtkPCFiles);%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating .pc files...</Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GenerateGtkPCX64)</Command>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GtkPCFiles);%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating .pc files...</Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateGtkPCX64)</Command>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GtkPCFiles);%(Outputs)</Outputs>
     </CustomBuild>
   </ItemGroup>
   <ItemGroup>
diff --git a/build/win32/vs10/gtk-install.vcxproj.filters b/build/win32/vs10/gtk-install.vcxproj.filters
new file mode 100644
index 0000000..21bc9a4
--- /dev/null
+++ b/build/win32/vs10/gtk-install.vcxproj.filters
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
+  <ItemGroup>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <CustomBuild Include="..\..\..\config.h.win32"><Filter>Resource Files</Filter></CustomBuild>
+    <CustomBuild Include="..\gtkpc.py"><Filter>Resource Files</Filter></CustomBuild>
+  </ItemGroup>
+</Project>
diff --git a/build/win32/vs10/gtk-version-paths.props b/build/win32/vs10/gtk-version-paths.props.in
similarity index 77%
rename from build/win32/vs10/gtk-version-paths.props
rename to build/win32/vs10/gtk-version-paths.props.in
index 7d8f5e9..fa40382 100644
--- a/build/win32/vs10/gtk-version-paths.props
+++ b/build/win32/vs10/gtk-version-paths.props.in
@@ -6,12 +6,18 @@
     <CopyDir>$(GlibEtcInstallRoot)</CopyDir>
     <DefDir>$(SolutionDir)$(Configuration)\$(Platform)\obj\$(ProjectName)</DefDir>
     <ApiVersion>2.0</ApiVersion>
+    <GtkVersion>@GTK_VERSION@</GtkVersion>
     <GtkLibtoolCompatibleDllPrefix>lib</GtkLibtoolCompatibleDllPrefix>
     <GtkLibtoolCompatibleDllSuffix>-$(ApiVersion)-0</GtkLibtoolCompatibleDllSuffix>
     <GtkSeparateVSDllPrefix />
     <GtkSeparateVSDllSuffix>-2-vs$(VSVer)</GtkSeparateVSDllSuffix>
+    <!-- Change these two to GtkLibtoolCompatibleDllPrefix and
+            GtkLibtoolCompatibleDllSuffix if that is what you want -->
     <GtkDllPrefix>$(GtkSeparateVSDllPrefix)</GtkDllPrefix>
     <GtkDllSuffix>$(GtkSeparateVSDllSuffix)</GtkDllSuffix>
+    <!-- Update the following to reflect the actual Python 2.x/3.x installation path on your system -->
+    <PythonPath>c:\python34</PythonPath>
+    <PythonPathX64>$(PythonPath).x64</PythonPathX64>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>gtkversionpathsprops</_PropertySheetDisplayName>
@@ -32,6 +38,9 @@
     <BuildMacro Include="ApiVersion">
       <Value>$(ApiVersion)</Value>
     </BuildMacro>
+    <BuildMacro Include="GtkVersion">
+      <Value>$(GtkVersion)</Value>
+    </BuildMacro>
     <BuildMacro Include="GtkLibtoolCompatibleDllPrefix">
       <Value>$(GtkLibtoolCompatibleDllPrefix)</Value>
     </BuildMacro>
@@ -50,5 +59,10 @@
     <BuildMacro Include="GtkDllSuffix">
       <Value>$(GtkDllSuffix)</Value>
     </BuildMacro>
+    <BuildMacro Include="PythonPath">
+      <Value>$(PythonPath)</Value>
+    </BuildMacro>
+    <BuildMacro Include="PythonPathX64">
+      <Value>$(PythonPathX64)</Value>
   </ItemGroup>
 </Project>
diff --git a/build/win32/vs11/Makefile.am b/build/win32/vs11/Makefile.am
index 44711fa..e6cac32 100644
--- a/build/win32/vs11/Makefile.am
+++ b/build/win32/vs11/Makefile.am
@@ -21,7 +21,8 @@ EXTRA_DIST += \
        libwimp.vcxproj.filters \
        gtk-update-icon-cache.vcxproj   \
        gtk-update-icon-cache.vcxproj.filters   \
-       gtk-install.vcxproj
+       gtk-install.vcxproj     \
+       gtk-install.vcxproj.filters
 
 DISTCLEANFILES = $(EXTRA_DIST)
 
diff --git a/build/win32/vs12/Makefile.am b/build/win32/vs12/Makefile.am
index bb87a88..238457d 100644
--- a/build/win32/vs12/Makefile.am
+++ b/build/win32/vs12/Makefile.am
@@ -21,7 +21,8 @@ EXTRA_DIST += \
        libwimp.vcxproj.filters \
        gtk-update-icon-cache.vcxproj   \
        gtk-update-icon-cache.vcxproj.filters   \
-       gtk-install.vcxproj
+       gtk-install.vcxproj     \
+       gtk-install.vcxproj.filters
 
 DISTCLEANFILES = $(EXTRA_DIST)
 
diff --git a/build/win32/vs14/Makefile.am b/build/win32/vs14/Makefile.am
index 147d3cd..c70c343 100644
--- a/build/win32/vs14/Makefile.am
+++ b/build/win32/vs14/Makefile.am
@@ -21,7 +21,8 @@ EXTRA_DIST += \
        libwimp.vcxproj.filters \
        gtk-update-icon-cache.vcxproj   \
        gtk-update-icon-cache.vcxproj.filters   \
-       gtk-install.vcxproj
+       gtk-install.vcxproj     \
+       gtk-install.vcxproj.filters
 
 DISTCLEANFILES = $(EXTRA_DIST)
 
diff --git a/build/win32/vs9/gtk-install.vcproj b/build/win32/vs9/gtk-install.vcproj
index 2396b9a..8b06de9 100644
--- a/build/win32/vs9/gtk-install.vcproj
+++ b/build/win32/vs9/gtk-install.vcproj
@@ -28,7 +28,7 @@
                        DeleteExtensionsOnClean=""
                        >
                        <Tool
-                               Name="VCPreBuildEventTool"
+                               Name="VCPostBuildEventTool"
                                CommandLine="$(GtkDoInstall)"
                        />
                </Configuration>
@@ -41,7 +41,7 @@
                        DeleteExtensionsOnClean=""
                        >
                        <Tool
-                               Name="VCPreBuildEventTool"
+                               Name="VCPostBuildEventTool"
                                CommandLine="$(GtkDoInstall)"
                        />
                </Configuration>
@@ -55,7 +55,7 @@
                        DeleteExtensionsOnClean=""
                        >
                        <Tool
-                               Name="VCPreBuildEventTool"
+                               Name="VCPostBuildEventTool"
                                CommandLine="$(GtkDoInstall)"
                        />
                </Configuration>
@@ -69,9 +69,47 @@
                        DeleteExtensionsOnClean=""
                        >
                        <Tool
-                               Name="VCPreBuildEventTool"
+                               Name="VCPostBuildEventTool"
                                CommandLine="$(GtkDoInstall)"
                        />
                </Configuration>
        </Configurations>
+       <Files>
+               <Filter
+                       Name="Resource Files"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+                       <File RelativePath="..\gtkpc.py">
+                               <FileConfiguration Name="Debug|Win32">
+                                       <Tool Name="VCCustomBuildTool"
+                                               Description="Generating .pc files..."
+                                               CommandLine="$(GenerateGtkPC)"
+                                               Outputs="..\gdk-2.0.pc;..\gtk+-2.0.pc;..\gail.pc"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Release|Win32">
+                                       <Tool Name="VCCustomBuildTool"
+                                               Description="Generating .pc files..."
+                                               CommandLine="$(GenerateGtkPC)"
+                                               Outputs="..\gdk-2.0.pc;..\gtk+-2.0.pc;..\gail.pc"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Debug|x64">
+                                       <Tool Name="VCCustomBuildTool"
+                                               Description="Generating .pc files..."
+                                               CommandLine="$(GenerateGtkPCX64)"
+                                               Outputs="..\gdk-2.0.pc;..\gtk+-2.0.pc;..\gail.pc"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Release|x64">
+                                       <Tool Name="VCCustomBuildTool"
+                                               Description="Generating .pc files..."
+                                               CommandLine="$(GenerateGtkPCX64)"
+                                               Outputs="..\gdk-2.0.pc;..\gtk+-2.0.pc;..\gail.pc"
+                                       />
+                               </FileConfiguration>
+                       </File>
+               </Filter>
+       </Files>
 </VisualStudioProject>
diff --git a/build/win32/vs9/gtk-install.vspropsin b/build/win32/vs9/gtk-install.vspropsin
index 4d1041f..8da8207 100644
--- a/build/win32/vs9/gtk-install.vspropsin
+++ b/build/win32/vs9/gtk-install.vspropsin
@@ -61,6 +61,20 @@ mkdir $(CopyDir)\share\themes\Raleigh\gtk-$(ApiVersion)&#x0D;&#x0A;
 copy ..\..\..\gtk\gtkrc.default $(CopyDir)\share\themes\Raleigh\gtk-$(ApiVersion)\gtkrc&#x0D;&#x0A;
 
 if exist $(CopyDir)\share\icons\hicolor $(CopyDir)\bin\gtk-update-icon-cache.exe --ignore-theme-index 
--force &quot;$(CopyDir)\share\icons\hicolor&quot;&#x0D;&#x0A;
+
+mkdir $(CopyDir)\lib\pkgconfig&#x0D;&#x0A;
+copy ..\gdk-2.0.pc $(CopyDir)\lib\pkgconfig&#x0D;&#x0A;
+copy ..\gdk-2.0.pc $(CopyDir)\lib\pkgconfig\gdk-win32-2.0.pc&#x0D;&#x0A;
+copy &quot;..\gtk+-2.0.pc&quot; &quot;$(CopyDir)\lib\pkgconfig&quot;&#x0D;&#x0A;
+copy &quot;..\gtk+-2.0.pc&quot; &quot;$(CopyDir)\lib\pkgconfig\gtk+-win32-2.0.pc&quot;&#x0D;&#x0A;
                      "
        />
+       <UserMacro
+               Name="GenerateGtkPC"
+               Value="$(PythonPath)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) 
--host=i686-pc-vs$(VSVer)"
+       />
+       <UserMacro
+               Name="GenerateGtkPCX64"
+               Value="$(PythonPathX64)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) 
--host=x86_64-pc-vs$(VSVer)"
+       />
 </VisualStudioPropertySheet>
diff --git a/build/win32/vs9/gtk-version-paths.vsprops b/build/win32/vs9/gtk-version-paths.vsprops.in
similarity index 79%
rename from build/win32/vs9/gtk-version-paths.vsprops
rename to build/win32/vs9/gtk-version-paths.vsprops.in
index 910c4d8..65f6b0d 100644
--- a/build/win32/vs9/gtk-version-paths.vsprops
+++ b/build/win32/vs9/gtk-version-paths.vsprops.in
@@ -25,6 +25,10 @@
                Value="2.0"
        />
        <UserMacro
+               Name="GtkVersion"
+               Value="@GTK_VERSION@"
+       />
+       <UserMacro
                Name="GtkLibtoolCompatibleDllPrefix"
                Value="lib"
        />
@@ -50,4 +54,13 @@
                Name="GtkDllSuffix"
                Value="$(GtkSeparateVSDllSuffix)"
        />
+       <!-- Update the following to reflect the actual Python 2.x/3.x installation path on your system -->
+       <UserMacro
+               Name="PythonPath"
+               Value="c:\python27"
+       />
+       <UserMacro
+               Name="PythonPathX64"
+               Value="$(PythonPath).x64"
+       />
 </VisualStudioPropertySheet>
diff --git a/configure.ac b/configure.ac
index 4e11b40..9b7151a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1741,7 +1741,9 @@ docs/tutorial/Makefile
 build/Makefile
 build/win32/Makefile
 build/win32/vs9/Makefile
+build/win32/vs9/gtk-version-paths.vsprops
 build/win32/vs10/Makefile
+build/win32/vs10/gtk-version-paths.props
 build/win32/vs11/Makefile
 build/win32/vs12/Makefile
 build/win32/vs14/Makefile


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]