diff --git a/3rdparty/OpenAL/CMakeLists.txt b/3rdparty/OpenAL/CMakeLists.txt index 2100de3b4f..f37a776a1f 100644 --- a/3rdparty/OpenAL/CMakeLists.txt +++ b/3rdparty/OpenAL/CMakeLists.txt @@ -1,13 +1,17 @@ # OpenAL if(USE_SYSTEM_OPENAL) - find_package(OpenAL REQUIRED) - add_library(3rdparty_openal INTERFACE) - target_include_directories(3rdparty_openal INTERFACE ${OPENAL_INCLUDE_DIR}) - target_link_libraries(3rdparty_openal INTERFACE ${OPENAL_LIBRARY}) + if(WIN32) + find_package(OpenAL CONFIG REQUIRED) + else() + find_package(OpenAL REQUIRED) + endif() + add_library(3rdparty_openal INTERFACE) + target_link_libraries(3rdparty_openal INTERFACE OpenAL::OpenAL) + set_target_properties(OpenAL::OpenAL PROPERTIES IMPORTED_GLOBAL ON) else() - option(ALSOFT_UTILS "Build utility programs" OFF) - option(ALSOFT_EXAMPLES "Build example programs" OFF) - add_subdirectory(openal-soft EXCLUDE_FROM_ALL) - add_library(3rdparty_openal INTERFACE) - target_link_libraries(3rdparty_openal INTERFACE OpenAL::OpenAL) + option(ALSOFT_UTILS "Build utility programs" OFF) + option(ALSOFT_EXAMPLES "Build example programs" OFF) + add_subdirectory(openal-soft EXCLUDE_FROM_ALL) + add_library(3rdparty_openal INTERFACE) + target_link_libraries(3rdparty_openal INTERFACE OpenAL::OpenAL) endif() diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index edd9dcf59d..1512de77de 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -143,11 +143,8 @@ elseif(UNIX) COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $/GuiConfigs COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $/git) elseif(WIN32) - if(MSVC) - add_custom_command(TARGET rpcs3 POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/3rdparty/OpenAL/openal-soft/$/OpenAL32.dll $) - endif() add_custom_command(TARGET rpcs3 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ $ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $/Icons COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $/GuiConfigs COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $/git