FindOpenAL: Detect Windows architecture-specific installation

Some OpenAL implementations on Windows provide both Win32 and Win64
binaries.  Search the location of the matching architecture.

Author: George "Zogzer@GitHub" <insertlogic@gmail.com>
This commit is contained in:
Brad King 2015-12-10 09:14:54 -05:00
parent dc873f6eef
commit 39abbaed77
1 changed files with 8 additions and 1 deletions

View File

@ -79,11 +79,17 @@ find_path(OPENAL_INCLUDE_DIR al.h
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
) )
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_OpenAL_ARCH_DIR libs/Win64)
else()
set(_OpenAL_ARCH_DIR libs/Win32)
endif()
find_library(OPENAL_LIBRARY find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32 NAMES OpenAL al openal OpenAL32
HINTS HINTS
ENV OPENALDIR ENV OPENALDIR
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATHS PATHS
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
@ -94,6 +100,7 @@ find_library(OPENAL_LIBRARY
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
) )
unset(_OpenAL_ARCH_DIR)
# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE