summaryrefslogtreecommitdiff
path: root/external/twain_dsm
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-12-22 20:46:12 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-02-03 07:49:12 +0100
commit585d9806961342e95f7318fb947bd31e9f86dee0 (patch)
tree99e31f1d2a7ec385540a405053e05cc6c109defd /external/twain_dsm
parenta1c36eff089c3cd695bd78090575ca1c7677121e (diff)
tdf#114635: Add TWAINDSM.DLL to 64-bit Windows package
This patch allows us to use our own bundled TWAINDSM.dll (from twain-dsm project, http://www.twain.org, https://github.com/twain/twain-dsm) on 64-bit Windows systems that don't have their own TWAIN DLL, and without requiring users to install it from some other source. The DLL is put into INSTALLOCATION/program along soffice.bin. Of course, TWAIN sources still need to be 64-bit themselves (i.e., true 64-bit TWAIN drivers required) to be usable by 64-bit program. Also this drops external/twain/inc/twain/twain.h, which is an old version copied from twain-dsm, and instead uses the tarball to get the header (required by Library_scn on both 32- and 64-bit Windows). Change-Id: I191027f3221ce46db17f50db91c9cb9315900810 Reviewed-on: https://gerrit.libreoffice.org/46992 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'external/twain_dsm')
-rw-r--r--external/twain_dsm/ExternalPackage_twain_dsm.mk20
-rw-r--r--external/twain_dsm/ExternalProject_twain_dsm.mk33
-rw-r--r--external/twain_dsm/Module_twain_dsm.mk24
-rw-r--r--external/twain_dsm/README1
-rw-r--r--external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.filters.patch54
-rw-r--r--external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.patch263
-rw-r--r--external/twain_dsm/UnpackedTarball_twain_dsm.mk21
7 files changed, 416 insertions, 0 deletions
diff --git a/external/twain_dsm/ExternalPackage_twain_dsm.mk b/external/twain_dsm/ExternalPackage_twain_dsm.mk
new file mode 100644
index 000000000000..a2d1bb2ad32e
--- /dev/null
+++ b/external/twain_dsm/ExternalPackage_twain_dsm.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,twain_dsm,twain_dsm))
+
+$(eval $(call gb_ExternalPackage_use_external_project,twain_dsm,twain_dsm))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,twain_dsm,$(LIBO_BIN_FOLDER)/TWAINDSM.dll,PCBuild/out/TWAINDSM.dll))
+endif
+
+# headers are not delivered, but used from unpacked dir pub/include/
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/twain_dsm/ExternalProject_twain_dsm.mk b/external/twain_dsm/ExternalProject_twain_dsm.mk
new file mode 100644
index 000000000000..f1e2285f7583
--- /dev/null
+++ b/external/twain_dsm/ExternalProject_twain_dsm.mk
@@ -0,0 +1,33 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,twain_dsm))
+
+$(eval $(call gb_ExternalProject_use_unpacked,twain_dsm,twain_dsm))
+
+$(eval $(call gb_ExternalProject_register_targets,twain_dsm,\
+ build \
+))
+
+ifeq ($(OS),WNT)
+
+$(call gb_ExternalProject_get_state_target,twain_dsm,build) :
+ $(call gb_ExternalProject_run,build,\
+ MSBuild.exe visual_studio/TWAIN_DSM_VS2015.sln /t:Build \
+ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
+ /p:OutDir=../PCBuild/out/ /p:IntDir=../PCBuild/obj/ \
+ $(if $(filter 140,$(VCVER)),/p:PlatformToolset=v140 /p:VisualStudioVersion=14.0 /ToolsVersion:14.0) \
+ $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
+ $(if $(filter 150-10,$(VCVER)-$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/twain_dsm/Module_twain_dsm.mk b/external/twain_dsm/Module_twain_dsm.mk
new file mode 100644
index 000000000000..10db9b9a4dac
--- /dev/null
+++ b/external/twain_dsm/Module_twain_dsm.mk
@@ -0,0 +1,24 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,twain_dsm))
+
+ifeq ($(OS),WNT)
+
+$(eval $(call gb_Module_add_targets,twain_dsm,\
+ UnpackedTarball_twain_dsm \
+ $(if $(filter X86_64,$(CPUNAME)), \
+ ExternalProject_twain_dsm \
+ ExternalPackage_twain_dsm \
+ ) \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/twain_dsm/README b/external/twain_dsm/README
new file mode 100644
index 000000000000..b12e770010fe
--- /dev/null
+++ b/external/twain_dsm/README
@@ -0,0 +1 @@
+Windows scanner support. \ No newline at end of file
diff --git a/external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.filters.patch b/external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.filters.patch
new file mode 100644
index 000000000000..e73ae63dc855
--- /dev/null
+++ b/external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.filters.patch
@@ -0,0 +1,54 @@
+diff --git a/visual_studio/TWAIN_DSM_VS2015.vcxproj.filters b/visual_studio/TWAIN_DSM_VS2015.vcxproj.filters
+new file mode 100755
+index 000000000000..a17a30d0097f
+--- /dev/null
++++ b/visual_studio/TWAIN_DSM_VS2015.vcxproj.filters
+@@ -0,0 +1,47 @@
++<?xml version="1.0" encoding="utf-8"?>
++<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
++ <ItemGroup>
++ <Filter Include="Source Files">
++ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
++ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
++ </Filter>
++ <Filter Include="Header Files">
++ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
++ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
++ </Filter>
++ <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</Extensions>
++ </Filter>
++ </ItemGroup>
++ <ItemGroup>
++ <ClCompile Include="..\src\apps.cpp">
++ <Filter>Source Files</Filter>
++ </ClCompile>
++ <ClCompile Include="..\src\dsm.cpp">
++ <Filter>Source Files</Filter>
++ </ClCompile>
++ <ClCompile Include="..\src\hook.cpp">
++ <Filter>Source Files</Filter>
++ </ClCompile>
++ <ClCompile Include="..\src\log.cpp">
++ <Filter>Source Files</Filter>
++ </ClCompile>
++ </ItemGroup>
++ <ItemGroup>
++ <ClInclude Include="..\src\dsm.h">
++ <Filter>Header Files</Filter>
++ </ClInclude>
++ <ClInclude Include="..\src\resource.h">
++ <Filter>Header Files</Filter>
++ </ClInclude>
++ <ClInclude Include="..\src\twain.h">
++ <Filter>Header Files</Filter>
++ </ClInclude>
++ </ItemGroup>
++ <ItemGroup>
++ <ResourceCompile Include="..\src\dsm.rc">
++ <Filter>Resource Files</Filter>
++ </ResourceCompile>
++ </ItemGroup>
++</Project>
+\ No newline at end of file
diff --git a/external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.patch b/external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.patch
new file mode 100644
index 000000000000..86b87a4ff41b
--- /dev/null
+++ b/external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.patch
@@ -0,0 +1,263 @@
+diff --git a/visual_studio/TWAIN_DSM_VS2015.vcxproj b/visual_studio/TWAIN_DSM_VS2015.vcxproj
+new file mode 100755
+index 000000000000..425c39966171
+--- /dev/null
++++ b/visual_studio/TWAIN_DSM_VS2015.vcxproj
+@@ -0,0 +1,256 @@
++<?xml version="1.0" encoding="utf-8"?>
++<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
++ <ItemGroup Label="ProjectConfigurations">
++ <ProjectConfiguration Include="Debug|Win32">
++ <Configuration>Debug</Configuration>
++ <Platform>Win32</Platform>
++ </ProjectConfiguration>
++ <ProjectConfiguration Include="Debug|x64">
++ <Configuration>Debug</Configuration>
++ <Platform>x64</Platform>
++ </ProjectConfiguration>
++ <ProjectConfiguration Include="Release|Win32">
++ <Configuration>Release</Configuration>
++ <Platform>Win32</Platform>
++ </ProjectConfiguration>
++ <ProjectConfiguration Include="Release|x64">
++ <Configuration>Release</Configuration>
++ <Platform>x64</Platform>
++ </ProjectConfiguration>
++ </ItemGroup>
++ <PropertyGroup Label="Globals">
++ <ProjectGuid>{5F73EBC7-6A0E-4CBF-A37C-CB167E4CC379}</ProjectGuid>
++ <RootNamespace>TWAINDSM</RootNamespace>
++ <Keyword>Win32Proj</Keyword>
++ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
++ </PropertyGroup>
++ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
++ <ConfigurationType>DynamicLibrary</ConfigurationType>
++ <CharacterSet>MultiByte</CharacterSet>
++ <PlatformToolset>v140</PlatformToolset>
++ </PropertyGroup>
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
++ <ConfigurationType>DynamicLibrary</ConfigurationType>
++ <CharacterSet>MultiByte</CharacterSet>
++ <PlatformToolset>v140</PlatformToolset>
++ </PropertyGroup>
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
++ <ConfigurationType>DynamicLibrary</ConfigurationType>
++ <CharacterSet>MultiByte</CharacterSet>
++ <PlatformToolset>v140</PlatformToolset>
++ </PropertyGroup>
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
++ <ConfigurationType>DynamicLibrary</ConfigurationType>
++ <CharacterSet>MultiByte</CharacterSet>
++ <PlatformToolset>v140</PlatformToolset>
++ </PropertyGroup>
++ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
++ <ImportGroup Label="ExtensionSettings">
++ </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" />
++ </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" />
++ </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" />
++ </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" />
++ </ImportGroup>
++ <PropertyGroup Label="UserMacros" />
++ <PropertyGroup>
++ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
++ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)15_32\</OutDir>
++ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)15_32\</IntDir>
++ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
++ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)15_64\</OutDir>
++ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)15_64\</IntDir>
++ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
++ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)15_32\</OutDir>
++ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)15_32\</IntDir>
++ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
++ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)15_64\</OutDir>
++ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)15_64\</IntDir>
++ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
++ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
++ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
++ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
++ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
++ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
++ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
++ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
++ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
++ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
++ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
++ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
++ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
++ </PropertyGroup>
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
++ <TargetName>TWAINDSM</TargetName>
++ </PropertyGroup>
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
++ <TargetName>TWAINDSM</TargetName>
++ </PropertyGroup>
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
++ <TargetName>TWAINDSM</TargetName>
++ </PropertyGroup>
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
++ <TargetName>TWAINDSM</TargetName>
++ </PropertyGroup>
++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
++ <PreBuildEvent>
++ <Message>create pub folders if do not exist</Message>
++ <Command>
++ </Command>
++ </PreBuildEvent>
++ <ClCompile>
++ <Optimization>Disabled</Optimization>
++ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;TWAIN_DSM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ <MinimalRebuild>true</MinimalRebuild>
++ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
++ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
++ <PrecompiledHeader>
++ </PrecompiledHeader>
++ <WarningLevel>Level4</WarningLevel>
++ <TreatWarningAsError>true</TreatWarningAsError>
++ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
++ </ClCompile>
++ <Link>
++ <OutputFile>$(OutDir)TWAINDSM.dll</OutputFile>
++ <SuppressStartupBanner>true</SuppressStartupBanner>
++ <AdditionalLibraryDirectories>..\..\pub\external\lib;..\..\pub\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
++ <ModuleDefinitionFile>..\src\dsm.def</ModuleDefinitionFile>
++ <GenerateDebugInformation>true</GenerateDebugInformation>
++ <ProgramDatabaseFile>$(OutDir)TWAINDSM.pdb</ProgramDatabaseFile>
++ <SubSystem>Windows</SubSystem>
++ <RandomizedBaseAddress>true</RandomizedBaseAddress>
++ <DataExecutionPrevention>true</DataExecutionPrevention>
++ <ImportLibrary>$(OutDir)TWAINDSM.lib</ImportLibrary>
++ <TargetMachine>MachineX86</TargetMachine>
++ </Link>
++ </ItemDefinitionGroup>
++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
++ <PreBuildEvent>
++ <Message>create pub folders if do not exist</Message>
++ <Command>
++ </Command>
++ </PreBuildEvent>
++ <Midl>
++ <TargetEnvironment>X64</TargetEnvironment>
++ </Midl>
++ <ClCompile>
++ <Optimization>Disabled</Optimization>
++ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;TWAIN_DSM_EXPORTS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ <MinimalRebuild>true</MinimalRebuild>
++ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
++ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
++ <PrecompiledHeader>
++ </PrecompiledHeader>
++ <WarningLevel>Level4</WarningLevel>
++ <TreatWarningAsError>true</TreatWarningAsError>
++ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
++ </ClCompile>
++ <ResourceCompile>
++ <PreprocessorDefinitions>_VC80_UPGRADE=0x0710;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ </ResourceCompile>
++ <Link>
++ <OutputFile>$(ProjectDir)\$(OutDir)TWAINDSM.dll</OutputFile>
++ <SuppressStartupBanner>true</SuppressStartupBanner>
++ <AdditionalLibraryDirectories>..\..\pub\external\lib;..\..\pub\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
++ <ModuleDefinitionFile>..\src\dsm.def</ModuleDefinitionFile>
++ <GenerateDebugInformation>true</GenerateDebugInformation>
++ <ProgramDatabaseFile>$(OutDir)TWAINDSM.pdb</ProgramDatabaseFile>
++ <SubSystem>Windows</SubSystem>
++ <RandomizedBaseAddress>true</RandomizedBaseAddress>
++ <DataExecutionPrevention>true</DataExecutionPrevention>
++ <ImportLibrary>$(OutDir)TWAINDSM.lib</ImportLibrary>
++ <TargetMachine>MachineX64</TargetMachine>
++ </Link>
++ </ItemDefinitionGroup>
++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
++ <PreBuildEvent>
++ <Message>create pub folders if do not exist</Message>
++ <Command>
++ </Command>
++ </PreBuildEvent>
++ <ClCompile>
++ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;TWAIN_DSM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
++ <PrecompiledHeader>
++ </PrecompiledHeader>
++ <WarningLevel>Level3</WarningLevel>
++ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
++ </ClCompile>
++ <Link>
++ <OutputFile>$(OutDir)TWAINDSM.dll</OutputFile>
++ <AdditionalLibraryDirectories>..\..\pub\external\lib;..\..\pub\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
++ <ModuleDefinitionFile>..\src\dsm.def</ModuleDefinitionFile>
++ <GenerateDebugInformation>true</GenerateDebugInformation>
++ <SubSystem>Windows</SubSystem>
++ <OptimizeReferences>true</OptimizeReferences>
++ <EnableCOMDATFolding>true</EnableCOMDATFolding>
++ <RandomizedBaseAddress>true</RandomizedBaseAddress>
++ <DataExecutionPrevention>true</DataExecutionPrevention>
++ <ImportLibrary>$(OutDir)TWAINDSM.lib</ImportLibrary>
++ <TargetMachine>MachineX86</TargetMachine>
++ </Link>
++ </ItemDefinitionGroup>
++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
++ <PreBuildEvent>
++ <Message>create pub folders if do not exist</Message>
++ <Command>
++ </Command>
++ </PreBuildEvent>
++ <Midl>
++ <TargetEnvironment>X64</TargetEnvironment>
++ </Midl>
++ <ClCompile>
++ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;TWAIN_DSM_EXPORTS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
++ <PrecompiledHeader>
++ </PrecompiledHeader>
++ <WarningLevel>Level3</WarningLevel>
++ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
++ </ClCompile>
++ <ResourceCompile>
++ <PreprocessorDefinitions>_VC80_UPGRADE=0x0710;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ </ResourceCompile>
++ <Link>
++ <OutputFile>$(ProjectDir)\$(OutDir)TWAINDSM.dll</OutputFile>
++ <AdditionalLibraryDirectories>..\..\pub\external\lib;..\..\pub\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
++ <ModuleDefinitionFile>..\src\dsm.def</ModuleDefinitionFile>
++ <GenerateDebugInformation>true</GenerateDebugInformation>
++ <SubSystem>Windows</SubSystem>
++ <OptimizeReferences>true</OptimizeReferences>
++ <EnableCOMDATFolding>true</EnableCOMDATFolding>
++ <RandomizedBaseAddress>true</RandomizedBaseAddress>
++ <DataExecutionPrevention>true</DataExecutionPrevention>
++ <ImportLibrary>$(OutDir)TWAINDSM.lib</ImportLibrary>
++ <TargetMachine>MachineX64</TargetMachine>
++ </Link>
++ </ItemDefinitionGroup>
++ <ItemGroup>
++ <ClCompile Include="..\src\apps.cpp" />
++ <ClCompile Include="..\src\dsm.cpp" />
++ <ClCompile Include="..\src\hook.cpp" />
++ <ClCompile Include="..\src\log.cpp" />
++ </ItemGroup>
++ <ItemGroup>
++ <ClInclude Include="..\src\dsm.h" />
++ <ClInclude Include="..\src\resource.h" />
++ <ClInclude Include="..\src\twain.h" />
++ </ItemGroup>
++ <ItemGroup>
++ <ResourceCompile Include="..\src\dsm.rc" />
++ </ItemGroup>
++ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
++ <ImportGroup Label="ExtensionTargets">
++ </ImportGroup>
++</Project>
+\ No newline at end of file
diff --git a/external/twain_dsm/UnpackedTarball_twain_dsm.mk b/external/twain_dsm/UnpackedTarball_twain_dsm.mk
new file mode 100644
index 000000000000..180aa4c5d390
--- /dev/null
+++ b/external/twain_dsm/UnpackedTarball_twain_dsm.mk
@@ -0,0 +1,21 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,twain_dsm))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,twain_dsm,$(TWAIN_DSM_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,twain_dsm,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,twain_dsm, \
+ external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.patch \
+ external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.filters.patch \
+))
+
+# vim: set noet sw=4 ts=4: