mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 05:53:22 +08:00
Add Kinect driver to OpenNI2 port
Add Kinect driver to OpenNI2 port. OpenNI2 port generate Kinect driver when Kinect SDK has been installed in your system.
This commit is contained in:
parent
8c4d55b8f3
commit
63153c58b9
@ -1,3 +1,3 @@
|
||||
Source: openni2
|
||||
Version: 2.2.0.33
|
||||
Version: 2.2.0.33-1
|
||||
Description: OpenNI is open source library for access to Natural Interaction (NI) devices such as RGB-D camera.
|
||||
|
41
ports/openni2/inherit_from_parent_or_project_defaults.patch
Normal file
41
ports/openni2/inherit_from_parent_or_project_defaults.patch
Normal file
@ -0,0 +1,41 @@
|
||||
diff --git a/Source/Drivers/Kinect/Kinect.vcxproj b/Source/Drivers/Kinect/Kinect.vcxproj
|
||||
index 7f54d04..08a49fe 100644
|
||||
--- a/Source/Drivers/Kinect/Kinect.vcxproj
|
||||
+++ b/Source/Drivers/Kinect/Kinect.vcxproj
|
||||
@@ -72,28 +72,29 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)Bin\$(Platform)-$(Configuration)\OpenNI2\Drivers\</OutDir>
|
||||
<IntDir>$(SolutionDir)Bin\Intermediate\$(Platform)-$(Configuration)\$(ProjectName)\</IntDir>
|
||||
- <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include</IncludePath>
|
||||
- <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;</LibraryPath>
|
||||
+ <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(IncludePath)</IncludePath>
|
||||
+ <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(LibraryPath)</LibraryPath>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)Bin\$(Platform)-$(Configuration)\OpenNI2\Drivers\</OutDir>
|
||||
<IntDir>$(SolutionDir)Bin\Intermediate\$(Platform)-$(Configuration)\$(ProjectName)\</IntDir>
|
||||
- <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;</IncludePath>
|
||||
- <LibraryPath>$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
|
||||
+ <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(IncludePath)</IncludePath>
|
||||
+ <LibraryPath>$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;$(LibraryPath)</LibraryPath>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)Bin\$(Platform)-$(Configuration)\OpenNI2\Drivers\</OutDir>
|
||||
<IntDir>$(SolutionDir)Bin\Intermediate\$(Platform)-$(Configuration)\$(ProjectName)\</IntDir>
|
||||
- <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;</IncludePath>
|
||||
- <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;</LibraryPath>
|
||||
+ <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(IncludePath)</IncludePath>
|
||||
+ <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(LibraryPath)</LibraryPath>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)Bin\$(Platform)-$(Configuration)\OpenNI2\Drivers\</OutDir>
|
||||
<IntDir>$(SolutionDir)Bin\Intermediate\$(Platform)-$(Configuration)\$(ProjectName)\</IntDir>
|
||||
- <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include</IncludePath>
|
||||
+ <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(IncludePath)</IncludePath>
|
||||
+ <LibraryPath>$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;$(LibraryPath)</LibraryPath>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
@ -39,9 +39,23 @@ vcpkg_extract_source_archive(${ARCHIVE})
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/upgrade_projects.patch"
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/disable_kinect.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/inherit_from_parent_or_project_defaults.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/replace_environment_variable.patch"
|
||||
)
|
||||
|
||||
get_filename_component(KINECTSDK10_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Kinect;SDKInstallPath]" ABSOLUTE CACHE)
|
||||
set(KINECTSDK10_INSTALLED FALSE)
|
||||
if(EXISTS "${KINECTSDK10_DIR}")
|
||||
set(KINECTSDK10_INSTALLED TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT ${KINECTSDK10_INSTALLED})
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/disable_kinect.patch"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Build OpenNI2
|
||||
vcpkg_build_msbuild(
|
||||
PROJECT_PATH "${SOURCE_PATH}/OpenNI.sln"
|
||||
@ -146,6 +160,15 @@ file(
|
||||
${CURRENT_PACKAGES_DIR}/bin/OpenNI2/Drivers
|
||||
)
|
||||
|
||||
if(${KINECTSDK10_INSTALLED})
|
||||
file(
|
||||
INSTALL
|
||||
"${SOURCE_BIN_PATH_RELEASE}/OpenNI2/Drivers/Kinect.dll"
|
||||
DESTINATION
|
||||
${CURRENT_PACKAGES_DIR}/bin/OpenNI2/Drivers
|
||||
)
|
||||
endif()
|
||||
|
||||
file(
|
||||
INSTALL
|
||||
"${SOURCE_CONFIG_PATH}/OpenNI.ini"
|
||||
@ -165,6 +188,15 @@ file(
|
||||
${CURRENT_PACKAGES_DIR}/debug/bin/OpenNI2/Drivers
|
||||
)
|
||||
|
||||
if(${KINECTSDK10_INSTALLED})
|
||||
file(
|
||||
INSTALL
|
||||
"${SOURCE_BIN_PATH_DEBUG}/OpenNI2/Drivers/Kinect.dll"
|
||||
DESTINATION
|
||||
${CURRENT_PACKAGES_DIR}/debug/bin/OpenNI2/Drivers
|
||||
)
|
||||
endif()
|
||||
|
||||
file(
|
||||
INSTALL
|
||||
"${SOURCE_CONFIG_PATH}/OpenNI.ini"
|
||||
@ -184,6 +216,15 @@ file(
|
||||
${CURRENT_PACKAGES_DIR}/tools/openni2/OpenNI2/Drivers
|
||||
)
|
||||
|
||||
if(${KINECTSDK10_INSTALLED})
|
||||
file(
|
||||
INSTALL
|
||||
"${SOURCE_BIN_PATH_RELEASE}/OpenNI2/Drivers/Kinect.dll"
|
||||
DESTINATION
|
||||
${CURRENT_PACKAGES_DIR}/tools/openni2/OpenNI2/Drivers
|
||||
)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(NUMBEROFBIT 32)
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
|
76
ports/openni2/replace_environment_variable.patch
Normal file
76
ports/openni2/replace_environment_variable.patch
Normal file
@ -0,0 +1,76 @@
|
||||
diff --git a/Source/Drivers/Kinect/Kinect.vcxproj b/Source/Drivers/Kinect/Kinect.vcxproj
|
||||
index 08a49fe..7fd8620 100644
|
||||
--- a/Source/Drivers/Kinect/Kinect.vcxproj
|
||||
+++ b/Source/Drivers/Kinect/Kinect.vcxproj
|
||||
@@ -101,7 +101,7 @@
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
- <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc;</AdditionalIncludeDirectories>
|
||||
+ <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;C:\Program Files\Microsoft SDKs\Kinect\v1.8\inc;</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions);_WINDOWS</PreprocessorDefinitions>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<TreatWarningAsError>false</TreatWarningAsError>
|
||||
@@ -109,7 +109,7 @@
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>Kinect10.lib;XnLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
- <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;$(KINECTSDK10_DIR)\lib\x86;</AdditionalLibraryDirectories>
|
||||
+ <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\x86;</AdditionalLibraryDirectories>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@@ -117,7 +117,7 @@
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
- <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc;</AdditionalIncludeDirectories>
|
||||
+ <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;C:\Program Files\Microsoft SDKs\Kinect\v1.8\inc;</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions);_WINDOWS</PreprocessorDefinitions>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<TreatWarningAsError>false</TreatWarningAsError>
|
||||
@@ -125,7 +125,7 @@
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>Kinect10.lib;XnLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
- <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;$(KINECTSDK10_DIR)\lib\amd64;</AdditionalLibraryDirectories>
|
||||
+ <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\amd64;</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>
|
||||
</IgnoreSpecificDefaultLibraries>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
@@ -139,7 +139,7 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
- <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc;</AdditionalIncludeDirectories>
|
||||
+ <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;C:\Program Files\Microsoft SDKs\Kinect\v1.8\inc;</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>false</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -147,7 +147,7 @@
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>Kinect10.lib;XnLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
- <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;$(KINECTSDK10_DIR)\lib\x86;</AdditionalLibraryDirectories>
|
||||
+ <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\x86;</AdditionalLibraryDirectories>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@@ -157,7 +157,7 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
- <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc;</AdditionalIncludeDirectories>
|
||||
+ <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;C:\Program Files\Microsoft SDKs\Kinect\v1.8\inc;</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>false</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -165,7 +165,7 @@
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>Kinect10.lib;XnLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
- <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;$(KINECTSDK10_DIR)\lib\amd64;</AdditionalLibraryDirectories>
|
||||
+ <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\amd64;</AdditionalLibraryDirectories>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
Loading…
x
Reference in New Issue
Block a user