diff --git a/ports/openni2/portfile.cmake b/ports/openni2/portfile.cmake index 5b832eaa42..7c15b40ec7 100644 --- a/ports/openni2/portfile.cmake +++ b/ports/openni2/portfile.cmake @@ -36,6 +36,15 @@ 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) +configure_file("${CMAKE_CURRENT_LIST_DIR}/replace_environment_variable.patch.in" "${CMAKE_CURRENT_LIST_DIR}/replace_environment_variable.patch" @ONLY) + vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/upgrade_projects.patch" @@ -43,12 +52,6 @@ vcpkg_apply_patches( "${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} @@ -240,7 +243,7 @@ file( "${SOURCE_BIN_PATH_RELEASE}/PS1080Console.exe" "${SOURCE_BIN_PATH_RELEASE}/PSLinkConsole.exe" DESTINATION - ${CURRENT_PACKAGES_DIR}/tools/openni2/ + ${CURRENT_PACKAGES_DIR}/tools/openni2 ) # Handle copyright diff --git a/ports/openni2/replace_environment_variable.patch b/ports/openni2/replace_environment_variable.patch.in similarity index 83% rename from ports/openni2/replace_environment_variable.patch rename to ports/openni2/replace_environment_variable.patch.in index a5bfe2a544..25abe7edfd 100644 --- a/ports/openni2/replace_environment_variable.patch +++ 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;C:\Program Files\Microsoft SDKs\Kinect\v1.8\inc; ++ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc; _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)\;C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\x86; ++ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\x86; true @@ -25,7 +25,7 @@ index 08a49fe..7fd8620 100644 Level3 Disabled - ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc; -+ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;C:\Program Files\Microsoft SDKs\Kinect\v1.8\inc; ++ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc; _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)\;C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\amd64; ++ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\amd64; @@ -43,7 +43,7 @@ index 08a49fe..7fd8620 100644 true true - ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc; -+ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;C:\Program Files\Microsoft SDKs\Kinect\v1.8\inc; ++ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc; 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)\;C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\x86; ++ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\x86; true @@ -61,7 +61,7 @@ index 08a49fe..7fd8620 100644 true true - ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;$(KINECTSDK10_DIR)\inc; -+ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;C:\Program Files\Microsoft SDKs\Kinect\v1.8\inc; ++ ..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc; 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)\;C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\amd64; ++ $(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\amd64; true