Prefer config mode for finding OpenAL

This commit is contained in:
David Hrdlička
2022-01-13 04:16:05 +01:00
parent 3305063f55
commit 7d758ea9cd
2 changed files with 7 additions and 2 deletions

View File

@@ -98,6 +98,7 @@ if(WIN32)
endif() endif()
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
# Optional features # Optional features
# #

View File

@@ -89,8 +89,12 @@ endif()
if(OPENAL) if(OPENAL)
find_package(OpenAL REQUIRED) find_package(OpenAL REQUIRED)
include_directories(${OPENAL_INCLUDE_DIR}) if(TARGET OpenAL::OpenAL)
target_link_libraries(86Box ${OPENAL_LIBRARY}) target_link_libraries(86Box OpenAL::OpenAL)
else()
include_directories(${OPENAL_INCLUDE_DIR})
target_link_libraries(86Box ${OPENAL_LIBRARY})
endif()
endif() endif()
find_package(SDL2 REQUIRED) find_package(SDL2 REQUIRED)