From 6f0f196a1a675823de3dae25bdc46978b29dcd68 Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Thu, 5 Oct 2017 01:02:36 +0900 Subject: [PATCH] Change to refer Kinect SDK 1.x that installed using vcpkg port Fix according to changes of Kinect SDK 1.x port. Change to refer Kinect SDK 1.x that installed using vcpkg port. It will be always generate the Kinect SDK 1.x driver, even when Kinect SDK 1.x is not installed in user system. --- ports/openni2/CONTROL | 3 +- ports/openni2/portfile.cmake | 47 ++----------------- .../replace_environment_variable.patch.in | 16 +++---- ports/openni2/upgrade_projects.patch | 11 ++++- 4 files changed, 25 insertions(+), 52 deletions(-) diff --git a/ports/openni2/CONTROL b/ports/openni2/CONTROL index 2f0e010e0e..72de4e8775 100644 --- a/ports/openni2/CONTROL +++ b/ports/openni2/CONTROL @@ -1,3 +1,4 @@ Source: openni2 -Version: 2.2.0.33-1 +Version: 2.2.0.33-2 +Build-Depends: kinectsdk1 Description: OpenNI is open source library for access to Natural Interaction (NI) devices such as RGB-D camera. diff --git a/ports/openni2/portfile.cmake b/ports/openni2/portfile.cmake index 7c15b40ec7..2e91bac3f8 100644 --- a/ports/openni2/portfile.cmake +++ b/ports/openni2/portfile.cmake @@ -36,13 +36,7 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -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() - -file(TO_NATIVE_PATH ${KINECTSDK10_DIR} KINECTSDK10_DIR) +file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) configure_file("${CMAKE_CURRENT_LIST_DIR}/replace_environment_variable.patch.in" "${CMAKE_CURRENT_LIST_DIR}/replace_environment_variable.patch" @ONLY) vcpkg_apply_patches( @@ -52,13 +46,6 @@ vcpkg_apply_patches( "${CMAKE_CURRENT_LIST_DIR}/replace_environment_variable.patch" ) -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" @@ -154,6 +141,7 @@ file( file( INSTALL + "${SOURCE_BIN_PATH_RELEASE}/OpenNI2/Drivers/Kinect.dll" "${SOURCE_BIN_PATH_RELEASE}/OpenNI2/Drivers/OniFile.dll" "${SOURCE_BIN_PATH_RELEASE}/OpenNI2/Drivers/PS1080.dll" "${SOURCE_CONFIG_PATH}/OpenNI2/Drivers/PS1080.ini" @@ -163,15 +151,6 @@ 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" @@ -182,6 +161,7 @@ file( file( INSTALL + "${SOURCE_BIN_PATH_DEBUG}/OpenNI2/Drivers/Kinect.dll" "${SOURCE_BIN_PATH_DEBUG}/OpenNI2/Drivers/OniFile.dll" "${SOURCE_BIN_PATH_DEBUG}/OpenNI2/Drivers/PS1080.dll" "${SOURCE_CONFIG_PATH}/OpenNI2/Drivers/PS1080.ini" @@ -191,15 +171,6 @@ 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" @@ -210,6 +181,7 @@ file( file( INSTALL + "${SOURCE_BIN_PATH_RELEASE}/OpenNI2/Drivers/Kinect.dll" "${SOURCE_BIN_PATH_RELEASE}/OpenNI2/Drivers/OniFile.dll" "${SOURCE_BIN_PATH_RELEASE}/OpenNI2/Drivers/PS1080.dll" "${SOURCE_CONFIG_PATH}/OpenNI2/Drivers/PS1080.ini" @@ -219,15 +191,6 @@ 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") @@ -248,4 +211,4 @@ file( # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openni2) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/openni2/LICENSE ${CURRENT_PACKAGES_DIR}/share/openni2/copyright) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/openni2/LICENSE ${CURRENT_PACKAGES_DIR}/share/openni2/copyright) \ No newline at end of file diff --git a/ports/openni2/replace_environment_variable.patch.in b/ports/openni2/replace_environment_variable.patch.in index 25abe7edfd..ac5cf017c7 100644 --- a/ports/openni2/replace_environment_variable.patch.in +++ b/ports/openni2/replace_environment_variable.patch.in @@ -7,7 +7,7 @@ index 08a49fe..7fd8620 100644 Level3 Disabled - ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc; -+ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc; ++ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@NATIVE_VCPKG_ROOT_DIR@\packages\kinectsdk1_x86-windows\include _WINDLL;%(PreprocessorDefinitions);_WINDOWS false false @@ -16,7 +16,7 @@ index 08a49fe..7fd8620 100644 true Kinect10.lib;XnLib.lib;%(AdditionalDependencies) - $(SolutionDir)Bin\$(Platform)-$(Configuration)\;$(KINECTSDK10_DIR)\lib\x86; -+ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\x86; ++ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@NATIVE_VCPKG_ROOT_DIR@\packages\kinectsdk1_x86-windows\debug\lib true @@ -25,7 +25,7 @@ index 08a49fe..7fd8620 100644 Level3 Disabled - ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc; -+ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc; ++ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@NATIVE_VCPKG_ROOT_DIR@\packages\kinectsdk1_x64-windows\include _WINDLL;%(PreprocessorDefinitions);_WINDOWS false false @@ -34,7 +34,7 @@ index 08a49fe..7fd8620 100644 true Kinect10.lib;XnLib.lib;%(AdditionalDependencies) - $(SolutionDir)Bin\$(Platform)-$(Configuration)\;$(KINECTSDK10_DIR)\lib\amd64; -+ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\amd64; ++ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@NATIVE_VCPKG_ROOT_DIR@\packages\kinectsdk1_x64-windows\debug\lib @@ -43,7 +43,7 @@ index 08a49fe..7fd8620 100644 true true - ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc; -+ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc; ++ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@NATIVE_VCPKG_ROOT_DIR@\packages\kinectsdk1_x86-windows\include false @@ -52,7 +52,7 @@ index 08a49fe..7fd8620 100644 true Kinect10.lib;XnLib.lib;%(AdditionalDependencies) - $(SolutionDir)Bin\$(Platform)-$(Configuration)\;$(KINECTSDK10_DIR)\lib\x86; -+ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\x86; ++ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@NATIVE_VCPKG_ROOT_DIR@\packages\kinectsdk1_x86-windows\lib true @@ -61,7 +61,7 @@ index 08a49fe..7fd8620 100644 true true - ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc; -+ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc; ++ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@NATIVE_VCPKG_ROOT_DIR@\packages\kinectsdk1_x64-windows\include false @@ -70,7 +70,7 @@ index 08a49fe..7fd8620 100644 true Kinect10.lib;XnLib.lib;%(AdditionalDependencies) - $(SolutionDir)Bin\$(Platform)-$(Configuration)\;$(KINECTSDK10_DIR)\lib\amd64; -+ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\amd64; ++ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@NATIVE_VCPKG_ROOT_DIR@\packages\kinectsdk1_x64-windows\lib true diff --git a/ports/openni2/upgrade_projects.patch b/ports/openni2/upgrade_projects.patch index 1a44381b04..86dee57949 100644 --- a/ports/openni2/upgrade_projects.patch +++ b/ports/openni2/upgrade_projects.patch @@ -837,7 +837,7 @@ index 56c5944..0401f3d 100644 AnySuitable Speed diff --git a/Source/Drivers/Kinect/Kinect.vcxproj b/Source/Drivers/Kinect/Kinect.vcxproj -index f54e8b2..7f54d04 100644 +index f54e8b2..6ea2656 100644 --- a/Source/Drivers/Kinect/Kinect.vcxproj +++ b/Source/Drivers/Kinect/Kinect.vcxproj @@ -2,4 +2,4 @@ @@ -895,6 +895,15 @@ index f54e8b2..7f54d04 100644 true +@@ -125,7 +129,7 @@ + + + +- true ++ false + + + @@ -135,7 +139,7 @@ true true