Dynamic path convert

Dynamic path convert of Kinect SDK directory in patch file.
This commit is contained in:
Tsukasa Sugiura 2017-08-17 00:05:05 +09:00
parent 63153c58b9
commit 1b7b814689
2 changed files with 18 additions and 15 deletions

View File

@ -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

View File

@ -7,7 +7,7 @@ index 08a49fe..7fd8620 100644
<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>
+ <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc;</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions);_WINDOWS</PreprocessorDefinitions>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<TreatWarningAsError>false</TreatWarningAsError>
@ -16,7 +16,7 @@ index 08a49fe..7fd8620 100644
<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>
+ <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\x86;</AdditionalLibraryDirectories>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
</ItemDefinitionGroup>
@ -25,7 +25,7 @@ index 08a49fe..7fd8620 100644
<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>
+ <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc;</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions);_WINDOWS</PreprocessorDefinitions>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<TreatWarningAsError>false</TreatWarningAsError>
@ -34,7 +34,7 @@ index 08a49fe..7fd8620 100644
<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>
+ <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\amd64;</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<IgnoreAllDefaultLibraries>
@ -43,7 +43,7 @@ index 08a49fe..7fd8620 100644
<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>
+ <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc;</AdditionalIncludeDirectories>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
@ -52,7 +52,7 @@ index 08a49fe..7fd8620 100644
<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>
+ <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\x86;</AdditionalLibraryDirectories>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
</ItemDefinitionGroup>
@ -61,7 +61,7 @@ index 08a49fe..7fd8620 100644
<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>
+ <AdditionalIncludeDirectories>..\..\..\Include;..\..\..\ThirdParty\PSCommon\XnLib\Include;@KINECTSDK10_DIR@\inc;</AdditionalIncludeDirectories>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
@ -70,7 +70,7 @@ index 08a49fe..7fd8620 100644
<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>
+ <AdditionalLibraryDirectories>$(SolutionDir)Bin\$(Platform)-$(Configuration)\;@KINECTSDK10_DIR@\lib\amd64;</AdditionalLibraryDirectories>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
</ItemDefinitionGroup>