[gtk+] Visual C++ Projects: Add rules to generate GTK DBus sources



commit c13c74114305a28ce811f95ef4e97084b8fd2b7c
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Nov 27 18:05:32 2013 +0800

    Visual C++ Projects: Add rules to generate GTK DBus sources
    
    Since commit 7c2a5072 the gtkdbusgenerated.[c|h] are not included in the
    dist tarball and thus have to be generated, which broke the Visual C++
    builds.
    
    This patch adds property sheets and custom build rules for the Visual C++
    projects so that gtkdbusgenerated.[c|h] will be generated upon building the
    GTK+ DLL sources.
    
    This also tells people building GTK+ from the projects that they need to
    have Python 2/3 installed and the Python interpretor needs to be in their
    PATH before building GTK+ from the projects.

 build/win32/vs10/Makefile.am              |    3 +-
 build/win32/vs10/README.txt               |    5 ++++
 build/win32/vs10/gtk-gen-sources.props    |   20 +++++++++++++++
 build/win32/vs10/gtk-version-paths.props  |    4 +-
 build/win32/vs10/gtk.vcxproj.filtersin    |    3 ++
 build/win32/vs10/gtk.vcxprojin            |   24 +++++++++++++++---
 build/win32/vs9/Makefile.am               |    3 +-
 build/win32/vs9/README.txt                |    5 ++++
 build/win32/vs9/gtk-gen-sources.vsprops   |   16 ++++++++++++
 build/win32/vs9/gtk-version-paths.vsprops |    4 +-
 build/win32/vs9/gtk.vcprojin              |   38 +++++++++++++++++++++++++---
 11 files changed, 111 insertions(+), 14 deletions(-)
---
diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am
index 44b2883..0a0120b 100644
--- a/build/win32/vs10/Makefile.am
+++ b/build/win32/vs10/Makefile.am
@@ -37,6 +37,7 @@ EXTRA_DIST += \
        gtk-version-paths.props \
        gtkprebuild-broadway.props      \
        gtkprebuild.props       \
-       gtk-copy-gdk-broadway.props
+       gtk-copy-gdk-broadway.props     \
+       gtk-gen-sources.props
 
 -include $(top_srcdir)/git.mk
diff --git a/build/win32/vs10/README.txt b/build/win32/vs10/README.txt
index 64c62dd..e00b083 100644
--- a/build/win32/vs10/README.txt
+++ b/build/win32/vs10/README.txt
@@ -20,6 +20,11 @@ ATK and GLib.  External dependencies are at least Cairo
 gettext-runtime, fontconfig*, freetype*, expat*.  See the 
 build/win32/vs10/README.txt file in glib for details where to unpack them.
 
+You will also need a Python 2.x/3.x interpretor installed on your system,
+which can be obtained from the official installers available from
+http://www.python.org.  Please note that the Python interpretor (python.exe)
+needs to be in your path before attempting the build of GTK+.
+
 It is recommended that one builds the dependencies with VS10 as far as
 possible, especially those from and using the GTK+ stack (i.e. GLib,
 Cairo, ATK, Pango, GDK-Pixbuf), so that crashes caused by mixing calls
diff --git a/build/win32/vs10/gtk-gen-sources.props b/build/win32/vs10/gtk-gen-sources.props
new file mode 100644
index 0000000..a2cdd1e
--- /dev/null
+++ b/build/win32/vs10/gtk-gen-sources.props
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
+  <ImportGroup Label="PropertySheets">
+    <Import Project="gtk-build-defines.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros">
+    <GenerateGtkDbusBuiltSources>
+cd ..\..\..\gtk
+
+python $(GlibEtcInstallRoot)\bin\gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk 
--generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml
+
+cd $(SolutionDir)
+    </GenerateGtkDbusBuiltSources>
+  </PropertyGroup>
+  <ItemGroup>
+    <BuildMacro Include="GenerateGtkDbusBuiltSources">
+      <Value>$(GenerateGtkDbusBuiltSources)</Value>
+    </BuildMacro>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/build/win32/vs10/gtk-version-paths.props b/build/win32/vs10/gtk-version-paths.props
index fe2829f..62c244a 100644
--- a/build/win32/vs10/gtk-version-paths.props
+++ b/build/win32/vs10/gtk-version-paths.props
@@ -2,9 +2,9 @@
 <Project DefaultTargets="Build" ToolsVersion="4.0" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
   <PropertyGroup Label="UserMacros">
     <VSVer>10</VSVer>
-    <GlibEtcInstallRoot>..\..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRoot>
+    <GlibEtcInstallRoot>$(SolutionDir)\..\..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRoot>
     <GlibEtcInstallRootFromBuildWin32>..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRootFromBuildWin32>
-    <CopyDir>$(GlibEtcInstallRoot)</CopyDir>
+    <CopyDir>..\..\..\..\vs$(VSVer)\$(Platform)</CopyDir>
     <ApiVersion>3.0</ApiVersion>
     <GtkLibtoolCompatibleDllPrefix>lib</GtkLibtoolCompatibleDllPrefix>
     <GtkLibtoolCompatibleDllSuffix>-$(ApiVersion)-0</GtkLibtoolCompatibleDllSuffix>
diff --git a/build/win32/vs10/gtk.vcxproj.filtersin b/build/win32/vs10/gtk.vcxproj.filtersin
index b5b1c98..f6be805 100644
--- a/build/win32/vs10/gtk.vcxproj.filtersin
+++ b/build/win32/vs10/gtk.vcxproj.filtersin
@@ -18,6 +18,9 @@
     <ResourceCompile Include="..\..\..\gtk\gtk-win32.rc"><Filter>Resource Files</Filter></ResourceCompile>
   </ItemGroup>
   <ItemGroup>
+    <CustomBuild Include="..\..\..\gtk\gtkdbusinterfaces.xml"><Filter>Resource Files</Filter></CustomBuild>
+  </ItemGroup>
+  <ItemGroup>
 #include "libgtk.vs10.sourcefiles.filters"
     <ClCompile Include="..\..\..\modules\input\gtkimcontextime.c"><Filter>Source Files</Filter></ClCompile>
     <ClCompile Include="..\..\..\modules\input\gtkimcontextmultipress.c"><Filter>Source 
Files</Filter></ClCompile>
diff --git a/build/win32/vs10/gtk.vcxprojin b/build/win32/vs10/gtk.vcxprojin
index 08057d9..80a94b3 100644
--- a/build/win32/vs10/gtk.vcxprojin
+++ b/build/win32/vs10/gtk.vcxprojin
@@ -51,19 +51,19 @@
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" 
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="gtk-build-defines.props" />
+    <Import Project="gtk-gen-sources.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" 
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="gtk-build-defines.props" />
+    <Import Project="gtk-gen-sources.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" 
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="gtk-build-defines.props" />
+    <Import Project="gtk-gen-sources.props" />
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" 
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="gtk-build-defines.props" />
+    <Import Project="gtk-gen-sources.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
@@ -159,6 +159,22 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <CustomBuild Include="..\..\..\gtk\gtkdbusinterfaces.xml">
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating GTK+ DBus 
Sources...</Message>
+      <Command 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GenerateGtkDbusBuiltSources)</Command>
+      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating GTK+ DBus 
Sources...</Message>
+      <Command 
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GenerateGtkDbusBuiltSources)</Command>
+      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating GTK+ DBus 
Sources...</Message>
+      <Command 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GenerateGtkDbusBuiltSources)</Command>
+      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating GTK+ DBus 
Sources...</Message>
+      <Command 
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateGtkDbusBuiltSources)</Command>
+      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h%(Outputs)</Outputs>
+    </CustomBuild>
+  </ItemGroup>
+  <ItemGroup>
     <ResourceCompile Include="..\..\..\gtk\gtk-win32.rc" />
   </ItemGroup>
   <ItemGroup>
diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am
index f56ec64..116847a 100644
--- a/build/win32/vs9/Makefile.am
+++ b/build/win32/vs9/Makefile.am
@@ -25,6 +25,7 @@ EXTRA_DIST += \
        gtk-version-paths.vsprops       \
        gtkprebuild.vsprops     \
        gtkprebuild-broadway.vsprops    \
-       gtk-copy-gdk-broadway.vsprops
+       gtk-copy-gdk-broadway.vsprops   \
+       gtk-gen-sources.vsprops
 
 -include $(top_srcdir)/git.mk
diff --git a/build/win32/vs9/README.txt b/build/win32/vs9/README.txt
index 7f0c6ba..0cf37f4 100644
--- a/build/win32/vs9/README.txt
+++ b/build/win32/vs9/README.txt
@@ -19,6 +19,11 @@ ATK and GLib.  External dependencies are at least Cairo
 gettext-runtime, fontconfig*, freetype*, expat*.  See the 
 build/win32/vs9/README.txt file in glib for details where to unpack them.
 
+You will also need a Python 2.x/3.x interpretor installed on your system,
+which can be obtained from the official installers available from
+http://www.python.org.  Please note that the Python interpretor (python.exe)
+needs to be in your path before attempting the build of GTK+.
+
 It is recommended that one builds the dependencies with VS9 as far as
 possible, especially those from and using the GTK+ stack (i.e. GLib,
 Cairo, ATK, Pango, GDK-Pixbuf), so that crashes caused by mixing calls
diff --git a/build/win32/vs9/gtk-gen-sources.vsprops b/build/win32/vs9/gtk-gen-sources.vsprops
new file mode 100644
index 0000000..c6f87c5
--- /dev/null
+++ b/build/win32/vs9/gtk-gen-sources.vsprops
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+       ProjectType="Visual C++"
+       Version="8.00"
+       Name="gtkgensourcesprops"
+       InheritedPropertySheets=".\gtk-build-defines.vsprops"
+       >
+       <UserMacro
+               Name="GenerateGtkDbusBuiltSources"
+               Value="
+cd ..\..\..\gtk&#x0D;&#x0A;
+python $(GlibEtcInstallRoot)\bin\gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk 
--generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml&#x0D;&#x0A;
+cd $(SolutionDir)&#x0D;&#x0A;
+                     "
+       />
+</VisualStudioPropertySheet>
\ No newline at end of file
diff --git a/build/win32/vs9/gtk-version-paths.vsprops b/build/win32/vs9/gtk-version-paths.vsprops
index 7a97b18..5fbda28 100644
--- a/build/win32/vs9/gtk-version-paths.vsprops
+++ b/build/win32/vs9/gtk-version-paths.vsprops
@@ -10,7 +10,7 @@
        />
        <UserMacro
                Name="GlibEtcInstallRoot"
-               Value="..\..\..\..\vs$(VSVer)\$(PlatformName)"
+               Value="$(SolutionDir)\..\..\..\..\vs$(VSVer)\$(PlatformName)"
        />
        <UserMacro
                Name="GlibEtcInstallRootFromBuildWin32"
@@ -18,7 +18,7 @@
        />
        <UserMacro
                Name="CopyDir"
-               Value="$(GlibEtcInstallRoot)"
+               Value="..\..\..\..\vs$(VSVer)\$(PlatformName)"
        />
        <UserMacro
                Name="ApiVersion"
diff --git a/build/win32/vs9/gtk.vcprojin b/build/win32/vs9/gtk.vcprojin
index 5ff0484..ebd6ab6 100644
--- a/build/win32/vs9/gtk.vcprojin
+++ b/build/win32/vs9/gtk.vcprojin
@@ -21,7 +21,7 @@
        <Configurations>
                <Configuration
                        Name="Debug|Win32"
-                       InheritedPropertySheets=".\gtk-build-defines.vsprops"
+                       InheritedPropertySheets=".\gtk-gen-sources.vsprops"
                        ConfigurationType="2"
                        CharacterSet="2"
                        >
@@ -53,7 +53,7 @@
                </Configuration>
                <Configuration
                        Name="Release|Win32"
-                       InheritedPropertySheets=".\gtk-build-defines.vsprops"
+                       InheritedPropertySheets=".\gtk-gen-sources.vsprops"
                        ConfigurationType="2"
                        CharacterSet="2"
                        WholeProgramOptimization="1"
@@ -85,7 +85,7 @@
                </Configuration>
                <Configuration
                        Name="Debug|x64"
-                       InheritedPropertySheets=".\gtk-build-defines.vsprops"
+                       InheritedPropertySheets=".\gtk-gen-sources.vsprops"
                        ConfigurationType="2"
                        CharacterSet="2"
                        >
@@ -117,7 +117,7 @@
                </Configuration>
                <Configuration
                        Name="Release|x64"
-                       InheritedPropertySheets=".\gtk-build-defines.vsprops"
+                       InheritedPropertySheets=".\gtk-gen-sources.vsprops"
                        ConfigurationType="2"
                        CharacterSet="2"
                        WholeProgramOptimization="1"
@@ -162,6 +162,36 @@
                        Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
                        UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
                        >
+                       <File RelativePath="..\..\..\gtk\gtkdbusinterfaces.xml">
+                               <FileConfiguration Name="Debug|Win32">
+                               <Tool Name="VCCustomBuildTool"
+                                               Description="Generating GTK+ DBus Sources..."
+                                               CommandLine="$(GenerateGtkDbusBuiltSources)"
+                                               
Outputs="..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Release|Win32">
+                                       <Tool Name="VCCustomBuildTool"
+                                               Description="Generating GTK+ DBus Sources..."
+                                               CommandLine="$(GenerateGtkDbusBuiltSources)"
+                                               
Outputs="..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Debug|x64">
+                                       <Tool Name="VCCustomBuildTool"
+                                               Description="Generating GTK+ DBus Sources..."
+                                               CommandLine="$(GenerateGtkDbusBuiltSources)"
+                                               
Outputs="..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Release|x64">
+                                       <Tool Name="VCCustomBuildTool"
+                                               Description="Generating GTK+ DBus Sources..."
+                                               CommandLine="$(GenerateGtkDbusBuiltSources)"
+                                               
Outputs="..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h"
+                                       />
+                               </FileConfiguration>
+                       </File>
                        <File RelativePath="..\..\..\gtk\gtk-win32.rc" />
                </Filter>
                <Filter


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