diff --git a/CMakeLists.txt b/CMakeLists.txt index 679ccdb2f8..b48116d31c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,13 +59,6 @@ set_package_properties(OpenSSL PROPERTIES TYPE REQUIRED ) -find_package(OpenAL REQUIRED) -set_package_properties(OpenAL PROPERTIES - URL "http://www.openal.org/" - DESCRIPTION "3D audio and EAX library" - TYPE REQUIRED -) - set(Python_ADDITIONAL_VERSIONS 2.7) find_package(PythonLibs REQUIRED) set_package_properties(PythonLibs PROPERTIES diff --git a/Sources/Plasma/Apps/plClient/CMakeLists.txt b/Sources/Plasma/Apps/plClient/CMakeLists.txt index e8166b1637..d011d5b1d1 100644 --- a/Sources/Plasma/Apps/plClient/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClient/CMakeLists.txt @@ -160,7 +160,6 @@ target_link_libraries(plClient pnUtils) target_link_libraries(plClient pnUUID) target_link_libraries(plClient ${PYTHON_LIBRARIES}) -target_link_libraries(plClient ${OPENAL_LIBRARY}) target_link_libraries(plClient ${OPENSSL_LIBRARIES}) target_link_libraries(plClient ${EXPAT_LIBRARY}) target_link_libraries(plClient ${JPEG_LIBRARY}) diff --git a/Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt index 4a5a83a21c..ad0f2fc1e0 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt @@ -3,10 +3,41 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") +# Skip CMake's built in FindOpenAL module and use OpenAL-Soft's config instead, if possible +find_package(OpenAL CONFIG QUIET) +if(NOT TARGET OpenAL::OpenAL) + message(DEBUG "OpenAL CMake Config not found, using FindOpenAL module.") + find_package(OpenAL REQUIRED) + add_library(OpenAL::OpenAL STATIC IMPORTED) + set_target_properties(OpenAL::OpenAL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${OPENAL_INCLUDE_DIR} + IMPORTED_LOCATION ${OPENAL_LIBRARY} + ) + if(WIN32) + set_target_properties(OpenAL::OpenAL PROPERTIES + INTERFACE_LINK_LIBRARIES WinMM + ) + endif() +else() + # Ensure the default RelWithDebInfo and MinSizeRel configs use the Release library with Visual C++. + # Otherwise, compile-time assertions occur due to iterator debug level + if(MSVC) + set_target_properties(OpenAL::OpenAL PROPERTIES + MAP_IMPORTED_CONFIG_MINSIZEREL Release + MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release + ) + endif() +endif() + +set_package_properties(OpenAL PROPERTIES + URL "https://openal-soft.org/" + DESCRIPTION "3D audio and EAX library" + TYPE REQUIRED +) + if(WIN32) include_directories(${DirectX_INCLUDE_DIR}) endif(WIN32) -include_directories(${OPENAL_INCLUDE_DIR}) if(PLASMA_USE_OPUS) include_directories(${Opus_INCLUDE_DIR}) @@ -53,6 +84,7 @@ set(plAudio_HEADERS ) add_library(plAudio STATIC ${plAudio_SOURCES} ${plAudio_HEADERS}) +target_link_libraries(plAudio OpenAL::OpenAL) source_group("Source Files" FILES ${plAudio_SOURCES}) source_group("Header Files" FILES ${plAudio_HEADERS}) diff --git a/Sources/Tests/FeatureTests/pfPythonTest/CMakeLists.txt b/Sources/Tests/FeatureTests/pfPythonTest/CMakeLists.txt index add491ffa6..518bc0a21c 100644 --- a/Sources/Tests/FeatureTests/pfPythonTest/CMakeLists.txt +++ b/Sources/Tests/FeatureTests/pfPythonTest/CMakeLists.txt @@ -1,6 +1,5 @@ include_directories(${GTEST_INCLUDE_DIR}) include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) -include_directories(${OPENAL_INCLUDE_DIR}) include_directories(../../../Plasma/CoreLib) include_directories(../../../Plasma/NucleusLib) include_directories(../../../Plasma/NucleusLib/inc) @@ -96,8 +95,6 @@ target_link_libraries(test_pfPython pnUtils) target_link_libraries(test_pfPython pnUUID) target_link_libraries(test_pfPython ${PYTHON_LIBRARIES}) - -target_link_libraries(test_pfPython ${OPENAL_LIBRARY}) target_link_libraries(test_pfPython ${OPENSSL_LIBRARIES}) target_link_libraries(test_pfPython ${EXPAT_LIBRARY}) target_link_libraries(test_pfPython ${JPEG_LIBRARY}) diff --git a/Sources/Tools/MaxMain/CMakeLists.txt b/Sources/Tools/MaxMain/CMakeLists.txt index 63a497f7e8..f046c0d30a 100644 --- a/Sources/Tools/MaxMain/CMakeLists.txt +++ b/Sources/Tools/MaxMain/CMakeLists.txt @@ -98,7 +98,6 @@ target_link_libraries(MaxMain ${DirectX_LIBRARIES}) target_link_libraries(MaxMain ${JPEG_LIBRARY}) target_link_libraries(MaxMain ${PNG_LIBRARY}) target_link_libraries(MaxMain ${Ogg_LIBRARIES}) -target_link_libraries(MaxMain ${OPENAL_LIBRARY}) target_link_libraries(MaxMain ${OPENSSL_LIBRARIES}) target_link_libraries(MaxMain ${PHYSX_LIBRARIES}) target_link_libraries(MaxMain ${PYTHON_LIBRARIES}) diff --git a/appveyor.yml b/appveyor.yml index 9246a5031c..04b8bd917f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -59,7 +59,7 @@ install: git pull 2> $null bootstrap-vcpkg.bat vcpkg integrate install - vcpkg install curl[sspi] expat freetype libjpeg-turbo libogg libpng libtheora libvorbis libvpx opus pcre speex string-theory zlib --triplet x86-windows-static-dyncrt 2> $null + vcpkg install curl[sspi] expat freetype libjpeg-turbo libogg libpng libtheora libvorbis libvpx openal-soft opus pcre speex string-theory zlib --triplet x86-windows-static-dyncrt 2> $null Write-Host "OK" -foregroundColor Green Set-Location $path diff --git a/vcpkg.txt b/vcpkg.txt new file mode 100644 index 0000000000..17194508d6 --- /dev/null +++ b/vcpkg.txt @@ -0,0 +1,15 @@ +bzip2 +curl +expat +freetype +libjpeg-turbo +libogg +libpng +libvorbis +libvpx +openal-soft +openssl +opus +speex +string-theory +zlib