Better AeoNWave detection

This commit is contained in:
Erik Hofman 2018-06-05 09:39:51 +02:00
parent 08258ee4b3
commit 03156a6d94
2 changed files with 55 additions and 46 deletions

View File

@ -226,6 +226,7 @@ else()
endif() endif()
if(NOT AAX_FOUND) if(NOT AAX_FOUND)
set(USE_AEONWAVE FALSE)
find_package(OpenAL REQUIRED) find_package(OpenAL REQUIRED)
endif() endif()

View File

@ -15,52 +15,60 @@
# This file is Public Domain (www.unlicense.org) # This file is Public Domain (www.unlicense.org)
# This is free and unencumbered software released into the public domain. # This is free and unencumbered software released into the public domain.
FIND_PATH(AAX_INCLUDE_DIR aax/aax.h if (AAX_LIBRARY AND AAX_INCLUDE_DIR)
HINTS # in cache already
$ENV{AAXDIR} set(AAX_FOUND TRUE)
$ENV{ProgramFiles}/aax else()
$ENV{ProgramFiles}/AeonWave find_path(AAX_INCLUDE_DIR aax/aax.h
$ENV{ProgramFiles}/Adalin/AeonWave HINTS
${CMAKE_SOURCE_DIR}/aax $ENV{AAXDIR}
PATH_SUFFIXES include $ENV{ProgramFiles}/aax
PATHS $ENV{ProgramFiles}/AeonWave
~/Library/Frameworks $ENV{ProgramFiles}/Adalin/AeonWave
/Library/Frameworks ${CMAKE_SOURCE_DIR}/aax
/usr/local PATH_SUFFIXES include
/usr PATHS
/opt ~/Library/Frameworks
) /Library/Frameworks
/usr/local
/usr
/opt
)
FIND_LIBRARY(AAX_LIBRARY find_library(AAX_LIBRARY
NAMES AAX aax libAAX NAMES AAX aax libAAX
HINTS HINTS
$ENV{AAXDIR} $ENV{AAXDIR}
$ENV{ProgramFiles}/AAX $ENV{ProgramFiles}/AAX
$ENV{ProgramFiles}/AeonWave $ENV{ProgramFiles}/AeonWave
$ENV{ProgramFiles}/Adalin/AeonWave $ENV{ProgramFiles}/Adalin/AeonWave
${CMAKE_BUILD_DIR}/aax ${CMAKE_BUILD_DIR}/aax
PATH_SUFFIXES lib64 lib lib/${CMAKE_LIBRARY_ARCHITECTURE} libs64 libs libs/Win32 libs/Win64 bin PATH_SUFFIXES lib64 lib lib/${CMAKE_LIBRARY_ARCHITECTURE} libs64 libs libs/Win32 libs/Win64 bin
PATHS PATHS
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
/usr/local /usr/local
/usr /usr
/opt /opt
) )
IF(AAX_LIBRARY AND AAX_INCLUDE_DIR) set(AAX_DEFINITIONS "")
SET(AAX_FOUND "YES") if (AAX_LIBRARY AND AAX_INCLUDE_DIR)
ELSE(AAX_LIBRARY AND AAX_INCLUDE_DIR) set(AAX_FOUND TRUE)
IF(NOT AAX_INCLUDE_DIR) endif()
MESSAGE(FATAL_ERROR "Unable to find the AAX library development files.")
SET(AAX_FOUND "NO") if (AAX_FOUND)
ENDIF(NOT AAX_INCLUDE_DIR) if (NOT Udns_FIND_QUIETLY)
IF(NOT AAX_LIBRARY) message(STATUS "Found AeonWave: ${AAX_LIBRARIES}")
IF(SINGLE_PACKAGE) endif ()
SET(AAX_LIBRARY "${aax_BUILD_DIR}/aax/AAX.lib") else ()
SET(AAX_FOUND "YES") if (Udns_FIND_REQUIRED)
ELSE(SINGLE_PACKAGE) message(FATAL_ERROR "Could not find AeonWave")
ENDIF(SINGLE_PACKAGE) endif ()
ENDIF(NOT AAX_LIBRARY) endif ()
ENDIF(AAX_LIBRARY AND AAX_INCLUDE_DIR)
# show the AAX_INCLUDE_DIRS and AAX_LIBRARIES variables only in the advanced view
mark_as_advanced(AAX_INCLUDE_DIRS AAX_LIBRARIES)
endif()