[json-glib] Visual Studio builds: Generate .pc files



commit 43da2c261c644be17894a3319b62c9125a569428
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Mar 13 17:01:21 2017 +0800

    Visual Studio builds: Generate .pc files
    
    Generate the .pc files for the package upon "install", so that we can
    use pkg-config to find this package.  This will help in situations like
    introspection or for build systems that make use of pkg-config to find
    dependencies.

 build/win32/vs10/Makefile.am                       |    1 +
 build/win32/vs10/json-glib-install.propsin         |   20 +++++----
 build/win32/vs10/json-glib-install.vcxproj         |   30 ++++++++------
 build/win32/vs10/json-glib-install.vcxproj.filters |   13 ++++++
 build/win32/vs10/json-glib-version-paths.props.in  |    4 ++
 build/win32/vs11/Makefile.am                       |    1 +
 build/win32/vs12/Makefile.am                       |    1 +
 build/win32/vs14/Makefile.am                       |    1 +
 build/win32/vs15/Makefile.am                       |    1 +
 build/win32/vs9/json-glib-install.vcproj           |   40 ++++++++++++++++++++
 build/win32/vs9/json-glib-install.vspropsin        |    6 +++
 build/win32/vs9/json-glib-version-paths.vsprops.in |    4 ++
 12 files changed, 100 insertions(+), 22 deletions(-)
---
diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am
index 60fbe74..5e8b093 100644
--- a/build/win32/vs10/Makefile.am
+++ b/build/win32/vs10/Makefile.am
@@ -36,6 +36,7 @@ EXTRA_DIST =  \
        gvariant.vcxproj                \
        gvariant.vcxproj.filters        \
        json-glib-install.vcxproj       \
+       json-glib-install.vcxproj.filters       \
        node.vcxproj            \
        node.vcxproj.filters    \
        object.vcxproj          \
diff --git a/build/win32/vs10/json-glib-install.propsin b/build/win32/vs10/json-glib-install.propsin
index 3f1be77..1bb5ca1 100644
--- a/build/win32/vs10/json-glib-install.propsin
+++ b/build/win32/vs10/json-glib-install.propsin
@@ -5,8 +5,6 @@
   </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
@@ -21,7 +19,11 @@ copy $(BinDir)\json-glib-*.pdb $(CopyDir)\bin
 
 mkdir $(CopyDir)\include\json-glib-$(ApiVersion)\json-glib
 #include "json-glib.vs10.headers"
-</JsonGlibDoInstall>
+
+if exist ..\json-glib.pc copy ..\json-glib.pc $(CopyDir)\lib\pkgconfig
+    </JsonGlibDoInstall>
+    <JSONGLibPCFiles>..\json-glib.pc</JSONGLibPCFiles>
+    <GenJSONGLibPC>if exist $(PythonPath)\python.exe ((if not exist $(CopyDir)\lib\pkgconfig mkdir 
$(CopyDir)\lib\pkgconfig) &amp; ($(PythonPath)\python.exe ..\jsonglibpc.py --prefix=$(CopyDir) 
--version=$(JsonGlibMajorVersion).$(JsonGlibMinorVersion).$(JsonGlibMicroVersion)))</GenJSONGLibPC>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>jsonglibinstallprops</_PropertySheetDisplayName>
@@ -30,14 +32,14 @@ mkdir $(CopyDir)\include\json-glib-$(ApiVersion)\json-glib
     <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>
+    <BuildMacro Include="JSONGLibPCFiles">
+      <Value>$(JSONGLibPCFiles)</Value>
+    </BuildMacro>
+    <BuildMacro Include="GenJSONGLibPC">
+      <Value>$(GenJSONGLibPC)</Value>
+    </BuildMacro>
   </ItemGroup>
 </Project>
diff --git a/build/win32/vs10/json-glib-install.vcxproj b/build/win32/vs10/json-glib-install.vcxproj
index 25551b6..9de6f0a 100644
--- a/build/win32/vs10/json-glib-install.vcxproj
+++ b/build/win32/vs10/json-glib-install.vcxproj
@@ -75,19 +75,23 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   </ItemDefinitionGroup>
   <ItemGroup>
-    <CustomBuild Include="..\config.h.win32">
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Installing Build 
Results...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(JsonGlibDoInstall)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Installing Build Results...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(JsonGlibDoInstall)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Installing Build 
Results...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(JsonGlibDoInstall)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Installing Build 
Results...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(JsonGlibDoInstall)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
+    <CustomBuild Include="install_holder">
+      <Message Condition="'$(Configuration)'=='Debug'">Installing Build Results...</Message>
+      <AdditionalInputs Condition="'$(Configuration)'=='Debug'">$(JSONGLibPCFiles)</AdditionalInputs>
+      <Command Condition="'$(Configuration)'=='Debug'">$(JsonGlibDoInstall)</Command>
+      <Outputs Condition="'$(Configuration)'=='Debug'">file_holder;%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)'=='Release'">Installing Build Results...</Message>
+      <AdditionalInputs Condition="'$(Configuration)'=='Release'">$(JSONGLibPCFiles)</AdditionalInputs>
+      <Command Condition="'$(Configuration)'=='Release'">$(JsonGlibDoInstall)</Command>
+      <Outputs Condition="'$(Configuration)'=='Release'">file_holder;%(Outputs)</Outputs>
+    </CustomBuild>
+    <CustomBuild Include="..\..\..\json-glib.pc.in">
+      <Message Condition="'$(Configuration)'=='Debug'">Generating .pc file(s)...</Message>
+      <Command Condition="'$(Configuration)'=='Debug'">$(GenJSONGLibPC)</Command>
+      <Outputs Condition="'$(Configuration)'=='Debug'">$(JSONGLibPCFiles);%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)'=='Release'">Generating .pc file(s)...</Message>
+      <Command Condition="'$(Configuration)'=='Release'">$(GenJSONGLibPC)</Command>
+      <Outputs Condition="'$(Configuration)'=='Release'">$(JSONGLibPCFiles);%(Outputs)</Outputs>
     </CustomBuild>
   </ItemGroup>
   <ItemGroup>
diff --git a/build/win32/vs10/json-glib-install.vcxproj.filters 
b/build/win32/vs10/json-glib-install.vcxproj.filters
new file mode 100644
index 0000000..5f4846e
--- /dev/null
+++ b/build/win32/vs10/json-glib-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="install_holder"><Filter>Resource Files</Filter></CustomBuild>
+    <CustomBuild Include="..\..\..\json-glib.pc.in"><Filter>Resource Files</Filter></CustomBuild>
+  </ItemGroup>
+</Project>
diff --git a/build/win32/vs10/json-glib-version-paths.props.in 
b/build/win32/vs10/json-glib-version-paths.props.in
index be940e9..cde4328 100644
--- a/build/win32/vs10/json-glib-version-paths.props.in
+++ b/build/win32/vs10/json-glib-version-paths.props.in
@@ -15,6 +15,7 @@
     <JsonGlibSeparateVSDllSuffix>-1-vs$(VSVer)</JsonGlibSeparateVSDllSuffix>
     <JsonGlibDllPrefix>$(JsonGlibSeparateVSDllPrefix)</JsonGlibDllPrefix>
     <JsonGlibDllSuffix>$(JsonGlibSeparateVSDllSuffix)</JsonGlibDllSuffix>
+    <PythonPath>c:\python34</PythonPath>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>jsonglibversionpathsprops</_PropertySheetDisplayName>
@@ -62,5 +63,8 @@
     <BuildMacro Include="DefDir">
       <Value>$(DefDir)</Value>
     </BuildMacro>
+    <BuildMacro Include="PythonPath">
+      <Value>$(PythonPath)</Value>
+    </BuildMacro>
   </ItemGroup>
 </Project>
diff --git a/build/win32/vs11/Makefile.am b/build/win32/vs11/Makefile.am
index fb8cb74..cc28057 100644
--- a/build/win32/vs11/Makefile.am
+++ b/build/win32/vs11/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST =  \
        gvariant.vcxproj                \
        gvariant.vcxproj.filters        \
        json-glib-install.vcxproj       \
+       json-glib-install.vcxproj.filters       \
        node.vcxproj            \
        node.vcxproj.filters    \
        object.vcxproj          \
diff --git a/build/win32/vs12/Makefile.am b/build/win32/vs12/Makefile.am
index 080ac32..80d7496 100644
--- a/build/win32/vs12/Makefile.am
+++ b/build/win32/vs12/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST =  \
        gvariant.vcxproj                \
        gvariant.vcxproj.filters        \
        json-glib-install.vcxproj       \
+       json-glib-install.vcxproj.filters       \
        node.vcxproj            \
        node.vcxproj.filters    \
        object.vcxproj          \
diff --git a/build/win32/vs14/Makefile.am b/build/win32/vs14/Makefile.am
index fe5c5ec..3570545 100644
--- a/build/win32/vs14/Makefile.am
+++ b/build/win32/vs14/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST =  \
        gvariant.vcxproj                \
        gvariant.vcxproj.filters        \
        json-glib-install.vcxproj       \
+       json-glib-install.vcxproj.filters       \
        node.vcxproj            \
        node.vcxproj.filters    \
        object.vcxproj          \
diff --git a/build/win32/vs15/Makefile.am b/build/win32/vs15/Makefile.am
index d5a2bd7..0d0cc1a 100644
--- a/build/win32/vs15/Makefile.am
+++ b/build/win32/vs15/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST =  \
        gvariant.vcxproj                \
        gvariant.vcxproj.filters        \
        json-glib-install.vcxproj       \
+       json-glib-install.vcxproj.filters       \
        node.vcxproj            \
        node.vcxproj.filters    \
        object.vcxproj          \
diff --git a/build/win32/vs9/json-glib-install.vcproj b/build/win32/vs9/json-glib-install.vcproj
index a530235..e766144 100644
--- a/build/win32/vs9/json-glib-install.vcproj
+++ b/build/win32/vs9/json-glib-install.vcproj
@@ -71,6 +71,46 @@
        <References>
        </References>
        <Files>
+               <Filter
+                       Name="Resource Files"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+                       <File RelativePath="..\..\..\json-glib.pc.in">
+                               <FileConfiguration Name="Debug|Win32">
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Generating .pc file(s)..."
+                                               CommandLine="$(GenJSONGLibPC)"
+                                               Outputs="..\json-glib.pc"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Release|Win32">
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Generating .pc file(s)..."
+                                               CommandLine="$(GenJSONGLibPC)"
+                                               Outputs="..\json-glib.pc"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Debug|x64">
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Generating .pc file(s)..."
+                                               CommandLine="$(GenJSONGLibPC)"
+                                               Outputs="..\json-glib.pc"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration Name="Release|x64">
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Generating .pc file(s)..."
+                                               CommandLine="$(GenJSONGLibPC)"
+                                               Outputs="..\json-glib.pc"
+                                       />
+                               </FileConfiguration>
+                       </File>
+               </Filter>
        </Files>
        <Globals>
        </Globals>
diff --git a/build/win32/vs9/json-glib-install.vspropsin b/build/win32/vs9/json-glib-install.vspropsin
index b7ca293..b09ba25 100644
--- a/build/win32/vs9/json-glib-install.vspropsin
+++ b/build/win32/vs9/json-glib-install.vspropsin
@@ -21,6 +21,12 @@ copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\json-glib-*.pdb $(Co
 
 mkdir $(CopyDir)\include\json-glib-$(ApiVersion)\json-glib&#x0D;&#x0A;
 #include "json-glib.headers"
+
+if exist ..\json-glib.pc copy ..\json-glib.pc $(CopyDir)\lib\pkgconfig&#x0D;&#x0A;
 "
        />
+       <UserMacro
+               Name="GenJSONGLibPC"
+               Value="if exist $(PythonPath)\python.exe ((if not exist $(CopyDir)\lib\pkgconfig mkdir 
$(CopyDir)\lib\pkgconfig) &amp; ($(PythonPath)\python.exe ..\jsonglibpc.py --prefix=$(CopyDir) 
--version=$(JsonGlibMajorVersion).$(JsonGlibMinorVersion).$(JsonGlibMicroVersion)))"
+       />
 </VisualStudioPropertySheet>
diff --git a/build/win32/vs9/json-glib-version-paths.vsprops.in 
b/build/win32/vs9/json-glib-version-paths.vsprops.in
index d9dbda7..e65e282 100644
--- a/build/win32/vs9/json-glib-version-paths.vsprops.in
+++ b/build/win32/vs9/json-glib-version-paths.vsprops.in
@@ -62,4 +62,8 @@
                Name="JsonGlibDllSuffix"
                Value="$(JsonGlibSeparateVSDllSuffix)"
        />
+       <UserMacro
+               Name="PythonPath"
+               Value="c:\python27"
+       />
 </VisualStudioPropertySheet>


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