Windows: Avoid () in environment variable references
Use nested variable evaluation instead.
This commit is contained in:
parent
c179b2898e
commit
e423f1c05d
|
@ -157,7 +157,8 @@ if(MSVC)
|
|||
"${msvc_install_dir}/../../VC/redist"
|
||||
"${base_dir}/VC/redist"
|
||||
"$ENV{ProgramFiles}/Microsoft Visual Studio ${v}.0/VC/redist"
|
||||
"$ENV{ProgramFiles(x86)}/Microsoft Visual Studio ${v}.0/VC/redist"
|
||||
set(programfilesx86 "ProgramFiles(x86)")
|
||||
"$ENV{${programfilesx86}}/Microsoft Visual Studio ${v}.0/VC/redist"
|
||||
)
|
||||
mark_as_advanced(MSVC${v}_REDIST_DIR)
|
||||
set(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
|
||||
|
|
|
@ -56,9 +56,10 @@ else()
|
|||
if(DEFINED "ENV{ProgramFiles}")
|
||||
list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
|
||||
endif()
|
||||
if(DEFINED "ENV{ProgramFiles(x86)}")
|
||||
set(programfilesx86 "ProgramFiles(x86)")
|
||||
if(DEFINED "ENV{${programfilesx86}}")
|
||||
# 64-bit binary. 32-bit program files are in ProgramFiles(x86).
|
||||
list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles(x86)}")
|
||||
list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{${programfilesx86}}")
|
||||
elseif(DEFINED "ENV{SystemDrive}")
|
||||
# Guess the 32-bit program files location.
|
||||
if(EXISTS "$ENV{SystemDrive}/Program Files (x86)")
|
||||
|
|
Loading…
Reference in New Issue