Improve functions that detect ProgramFiles in CMake

This commit is contained in:
Alexander Karatarakis 2017-02-24 15:02:10 -08:00
parent 95a9a98ede
commit beb1250fe4
2 changed files with 14 additions and 8 deletions

View File

@ -1,7 +1,10 @@
function(vcpkg_get_program_files_32_bit ret)
if(DEFINED ENV{ProgramFiles\(X86\)})
set(${ret} $ENV{ProgramFiles\(X86\)} PARENT_SCOPE)
else()
set(${ret} $ENV{PROGRAMFILES} PARENT_SCOPE)
set(ret_temp $ENV{ProgramFiles\(X86\)})
if (NOT DEFINED ret_temp)
set(ret_temp $ENV{PROGRAMFILES})
endif()
set(${ret} ${ret_temp} PARENT_SCOPE)
endfunction()

View File

@ -1,7 +1,10 @@
function(vcpkg_get_program_files_platform_bitness ret)
if(DEFINED ENV{ProgramW6432})
set(${ret} $ENV{ProgramW6432} PARENT_SCOPE)
else()
set(${ret} $ENV{PROGRAMFILES} PARENT_SCOPE)
set(ret_temp $ENV{ProgramW6432})
if (NOT DEFINED ret_temp)
set(ret_temp $ENV{PROGRAMFILES})
endif()
set(${ret} ${ret_temp} PARENT_SCOPE)
endfunction()