diff --git a/cmake/FindZSTD.cmake b/cmake/FindZSTD.cmake index 5a31dad..d9af1a1 100755 --- a/cmake/FindZSTD.cmake +++ b/cmake/FindZSTD.cmake @@ -28,9 +28,11 @@ set(zstd_incl_dirs "/usr/include" "/usr/local/include") if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(_ZSTD_x86 "(x86)") set(zstd_incl_dirs ${zstd_incl_dirs} "$ENV{PROGRAMFILES}/zstd/include") - set(zstd_incl_dirs ${zstd_incl_dirs} "$ENV{PROGRAMFILES(x86)}/zstd/include") + set(zstd_incl_dirs ${zstd_incl_dirs} "$ENV{PROGRAMFILES${_ZSTD_x86}}/zstd/include") set(zstd_incl_dirs ${zstd_incl_dirs} "$ENV{PROGRAMDATA}/chocolatey/lib/zstandard/tools/include") + unset(_ZSTD_x86) endif() if(ZSTD_INCLUDEDIR) @@ -45,9 +47,11 @@ find_path( set(zstd_lib_dirs "/usr/lib" "/usr/local/lib") if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(_ZSTD_x86 "(x86)") set(zstd_lib_dirs ${zstd_lib_dirs} "$ENV{PROGRAMFILES}/zstd/lib") - set(zstd_lib_dirs ${zstd_lib_dirs} "$ENV{PROGRAMFILES(x86)}/zstd/lib") + set(zstd_lib_dirs ${zstd_lib_dirs} "$ENV{PROGRAMFILES${_ZSTD_x86}}/zstd/lib") set(zstd_lib_dirs ${zstd_lib_dirs} "$ENV{PROGRAMDATA}/chocolatey/lib/zstandard/tools/dll") + unset(_ZSTD_x86) endif() if(ZSTD_LIBRARYDIR)