[json-glib] build: Clean up MSVC-related items in autotools build files



commit 5eedb10ae257b48ea4f6650f8b24240a2544b9a6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Jan 4 13:57:29 2016 +0800

    build: Clean up MSVC-related items in autotools build files
    
    This makes use of the common build/Makefile.msvcproj to create the full
    Visual Studio 2008/2010 project files from their respective templates,
    while making the autotools files cleaner.  As an added benefit, this also
    enables the list of headers to "install" to be filled in automatically
    during 'make dist', so that we will have to worry less about the addition
    or removal of public headers.

 build/win32/vs10/Makefile.am                 |   16 ++++++-
 build/win32/vs10/json-glib-install.props     |   54 --------------------------
 build/win32/vs10/json-glib-install.propsin   |   43 ++++++++++++++++++++
 build/win32/vs10/json-glib.vcxproj.filtersin |    2 +-
 build/win32/vs10/json-glib.vcxprojin         |    2 +-
 build/win32/vs9/Makefile.am                  |   14 ++++++-
 build/win32/vs9/json-glib-install.vsprops    |   39 ------------------
 build/win32/vs9/json-glib-install.vspropsin  |   26 ++++++++++++
 build/win32/vs9/json-glib.vcprojin           |    2 +-
 json-glib/Makefile.am                        |   51 +++++++-----------------
 10 files changed, 112 insertions(+), 137 deletions(-)
---
diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am
index 5eb300d..e0465ec 100644
--- a/build/win32/vs10/Makefile.am
+++ b/build/win32/vs10/Makefile.am
@@ -1,14 +1,21 @@
 NULL =
 
+GENERATED_ITEMS =      \
+       json-glib.vcxproj               \
+       json-glib.vcxproj.filters       \
+       json-glib-install.props
+
+json-glib-install.props: $(top_srcdir)/build/win32/vs10/json-glib-install.propsin json-glib.vs10.headers
+       $(CPP) -P - <$(top_srcdir)/build/win32/vs10/json-glib-install.propsin >$@
+       rm json-glib.vs10.headers
+
 EXTRA_DIST =   \
        json-glib.sln                   \
        json-glib-version-paths.props   \
        json-glib-build-defines.props   \
        json-glib-gen-srcs.props        \
-       json-glib-install.props \
-       json-glib.vcxproj               \
+       json-glib-install.propsin       \
        json-glib.vcxprojin             \
-       json-glib.vcxproj.filters       \
        json-glib.vcxproj.filtersin     \
        json-glib-format.vcxproj                \
        json-glib-format.vcxproj.filters        \
@@ -44,4 +51,7 @@ EXTRA_DIST =  \
        README.txt      \
        invalid.vcxproj \
        invalid.vcxproj.filters \
+       $(GENERATED_ITEMS)              \
        $(NULL)
+
+DISTCLEANFILES = $(GENERATED_ITEMS)
diff --git a/build/win32/vs10/json-glib-install.propsin b/build/win32/vs10/json-glib-install.propsin
new file mode 100644
index 0000000..3f1be77
--- /dev/null
+++ b/build/win32/vs10/json-glib-install.propsin
@@ -0,0 +1,43 @@
+<?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="json-glib-build-defines.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros">
+    <BinDir>$(SolutionDir)$(Configuration)\$(Platform)\bin</BinDir>
+    <InstalledDlls>$(BinDir)\$(JsonGlibDllPrefix)json-glib(JsonGlibDllSuffix).dll</InstalledDlls>
+    <InstalledBins>$(BinDir)\json-glib-format.exe;$(BinDir)\json-glib-validate.exe</InstalledBins>
+    <JsonGlibDoInstall>
+mkdir $(CopyDir)
+mkdir $(CopyDir)\bin
+mkdir $(CopyDir)\lib
+
+copy $(BinDir)\json-glib-$(ApiVersion).lib $(CopyDir)\lib
+
+copy $(BinDir)\$(JsonGlibDllPrefix)json-glib$(JsonGlibDllSuffix).dll $(CopyDir)\bin
+copy $(BinDir)\$(JsonGlibDllPrefix)json-glib$(JsonGlibDllSuffix).pdb $(CopyDir)\bin
+copy $(BinDir)\json-glib-*.exe $(CopyDir)\bin
+copy $(BinDir)\json-glib-*.pdb $(CopyDir)\bin
+
+mkdir $(CopyDir)\include\json-glib-$(ApiVersion)\json-glib
+#include "json-glib.vs10.headers"
+</JsonGlibDoInstall>
+  </PropertyGroup>
+  <PropertyGroup>
+    <_PropertySheetDisplayName>jsonglibinstallprops</_PropertySheetDisplayName>
+  </PropertyGroup>
+  <ItemGroup>
+    <BuildMacro Include="BinDir">
+      <Value>$(BinDir)</Value>
+    </BuildMacro>
+    <BuildMacro Include="InstalledDlls">
+      <Value>$(InstalledDlls)</Value>
+    </BuildMacro>
+    <BuildMacro Include="InstalledBins">
+      <Value>$(InstalledBins)</Value>
+    </BuildMacro>
+    <BuildMacro Include="JsonGlibDoInstall">
+      <Value>$(JsonGlibDoInstall)</Value>
+    </BuildMacro>
+  </ItemGroup>
+</Project>
diff --git a/build/win32/vs10/json-glib.vcxproj.filtersin b/build/win32/vs10/json-glib.vcxproj.filtersin
index 30ea641..173efb5 100644
--- a/build/win32/vs10/json-glib.vcxproj.filtersin
+++ b/build/win32/vs10/json-glib.vcxproj.filtersin
@@ -15,7 +15,7 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-#include "jsonglib.vs10.sourcefiles.filters"
+#include "json-glib.vs10.sourcefiles.filters"
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\config.h.win32"><Filter>Resource Files</Filter></CustomBuild>
diff --git a/build/win32/vs10/json-glib.vcxprojin b/build/win32/vs10/json-glib.vcxprojin
index b41c6c4..28ef760 100644
--- a/build/win32/vs10/json-glib.vcxprojin
+++ b/build/win32/vs10/json-glib.vcxprojin
@@ -167,7 +167,7 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-#include "jsonglib.vs10.sourcefiles"
+#include "json-glib.vs10.sourcefiles"
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\config.h.win32">
diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am
index 0072461..053b371 100644
--- a/build/win32/vs9/Makefile.am
+++ b/build/win32/vs9/Makefile.am
@@ -1,12 +1,19 @@
 NULL =
 
+GENERATED_ITEMS =      \
+       json-glib.vcproj        \
+       json-glib-install.vsprops
+
+json-glib-install.vsprops: $(top_srcdir)/build/win32/vs9/json-glib-install.vspropsin json-glib.headers
+       $(CPP) -P - <$(top_srcdir)/build/win32/vs9/json-glib-install.vspropsin >$@
+       rm json-glib.headers
+
 EXTRA_DIST =   \
        json-glib.sln                   \
        json-glib-version-paths.vsprops \
        json-glib-build-defines.vsprops \
        json-glib-gen-srcs.vsprops      \
-       json-glib-install.vsprops       \
-       json-glib.vcproj                \
+       json-glib-install.vspropsin     \
        json-glib.vcprojin              \
        json-glib-validate.vcproj       \
        json-glib-format.vcproj \
@@ -26,4 +33,7 @@ EXTRA_DIST =  \
        serialize-complex.vcproj        \
        serialize-full.vcproj           \
        serialize-simple.vcproj         \
+       $(GENERATED_ITEMS)              \
        $(NULL)
+
+DISTCLEANFILES = $(GENERATED_ITEMS)
diff --git a/build/win32/vs9/json-glib-install.vspropsin b/build/win32/vs9/json-glib-install.vspropsin
new file mode 100644
index 0000000..b7ca293
--- /dev/null
+++ b/build/win32/vs9/json-glib-install.vspropsin
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+       ProjectType="Visual C++"
+       Version="8.00"
+       Name="jsonglibinstallprops"
+       InheritedPropertySheets=".\json-glib-build-defines.vsprops"
+       >
+       <UserMacro
+               Name="JsonGlibDoInstall"
+               Value="
+mkdir $(CopyDir)&#x0D;&#x0A;
+mkdir $(CopyDir)\bin&#x0D;&#x0A;
+mkdir $(CopyDir)\lib&#x0D;&#x0A;
+
+copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\*.lib $(CopyDir)\lib&#x0D;&#x0A;
+
+copy 
$(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\$(JsonGlibDllPrefix)json-glib$(JsonGlibDllSuffix).dll 
$(CopyDir)\bin&#x0D;&#x0A;
+copy 
$(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\$(JsonGlibDllPrefix)json-glib$(JsonGlibDllSuffix).pdb 
$(CopyDir)\bin&#x0D;&#x0A;
+copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\json-glib-*.exe $(CopyDir)\bin&#x0D;&#x0A;
+copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\json-glib-*.pdb $(CopyDir)\bin&#x0D;&#x0A;
+
+mkdir $(CopyDir)\include\json-glib-$(ApiVersion)\json-glib&#x0D;&#x0A;
+#include "json-glib.headers"
+"
+       />
+</VisualStudioPropertySheet>
diff --git a/build/win32/vs9/json-glib.vcprojin b/build/win32/vs9/json-glib.vcprojin
index 4f13c72..351bcb5 100644
--- a/build/win32/vs9/json-glib.vcprojin
+++ b/build/win32/vs9/json-glib.vcprojin
@@ -144,7 +144,7 @@
                        Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
                        >
-#include "jsonglib.sourcefiles"
+#include "json-glib.sourcefiles"
                </Filter>
                <Filter
                        Name="Headers"
diff --git a/json-glib/Makefile.am b/json-glib/Makefile.am
index 1755879..e8dedf9 100644
--- a/json-glib/Makefile.am
+++ b/json-glib/Makefile.am
@@ -149,39 +149,18 @@ CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
 endif # HAVE_INTROSPECTION
 
 # visual studio
-dist-hook: ../build/win32/vs9/json-glib.vcproj ../build/win32/vs10/json-glib.vcxproj 
../build/win32/vs10/json-glib.vcxproj.filters
-
-../build/win32/vs9/json-glib.vcproj: $(top_srcdir)/build/win32/vs9/json-glib.vcprojin
-       for F in $(libjson_glib_1_0_la_SOURCES); do \
-               case $$F in \
-               *.c)    echo '   <File RelativePath="..\..\..\json-glib\'$$F'" />' \
-                       ;; \
-               esac; \
-       done >jsonglib.sourcefiles
-       $(CPP) -P - <$(top_srcdir)/build/win32/vs9/json-glib.vcprojin >$@
-       rm jsonglib.sourcefiles
-       
-../build/win32/vs10/json-glib.vcxproj: $(top_srcdir)/build/win32/vs10/json-glib.vcxprojin
-       for F in $(libjson_glib_1_0_la_SOURCES); do \
-               case $$F in \
-               *.c)    echo '    <ClCompile Include="..\..\..\json-glib\'$$F'" />' \
-                       ;; \
-               esac; \
-       done >jsonglib.vs10.sourcefiles
-       $(CPP) -P - <$(top_srcdir)/build/win32/vs10/json-glib.vcxprojin >$@
-       rm jsonglib.vs10.sourcefiles
-       
-../build/win32/vs10/json-glib.vcxproj.filters: $(top_srcdir)/build/win32/vs10/json-glib.vcxproj.filtersin
-       for F in $(libjson_glib_1_0_la_SOURCES); do \
-               case $$F in \
-               *.c)    echo '    <ClCompile 
Include="..\..\..\json-glib\'$$F'"><Filter>Sources</Filter></ClCompile>' \
-                       ;; \
-               esac; \
-       done >jsonglib.vs10.sourcefiles.filters
-       $(CPP) -P - <$(top_srcdir)/build/win32/vs10/json-glib.vcxproj.filtersin >$@
-       rm jsonglib.vs10.sourcefiles.filters
-
-# Let the VS9/VS10 Project files be cleared out before they are re-expanded...
-DISTCLEANFILES += ../build/win32/vs9/json-glib.vcproj  \
-                 ../build/win32/vs10/json-glib.vcxproj \
-                 ../build/win32/vs10/json-glib.vcxproj.filters
+
+MSVCPROJS = json-glib
+
+json_glib_FILES = $(libjson_glib_1_0_la_SOURCES)
+json_glib_EXCLUDES = jgdummy
+
+json_glib_HEADERS_DIR = $(jsonincludedir)
+json_glib_HEADERS_INST = $(jsoninclude_DATA)
+json_glib_HEADERS_EXCLUDES = jgdummy
+
+include $(top_srcdir)/build/Makefile.msvcproj
+
+dist-hook:     \
+       $(top_builddir)/build/win32/vs9/json-glib.vcproj        \
+       $(top_builddir)/build/win32/vs9/json-glib.headers


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