OpenAL find module will not add dll file to TARGET_RUNTIME_DLLS
Using the following code to find and link OpenAL:
find_package(OpenAL REQUIRED)
target_link_libraries(app PRIVATE OpenAL::OpenAL)
And then copying the required dlls using:
add_custom_command(TARGET app POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:app> COMMAND_EXPAND_LISTS)
does not result in the openal dll file being copied across. As far as I can tell this is because the IMPORTED target created by the find module is not shared and does not use the separate IMPORTED_IMPLIB
and IMPORTED_LOCATION
properties for the lib and dll files respectively.
I've verified this locally by changing it to a SHARED IMPORTED target and setting those propertie, but not sure if that is a suitable fix across all platforms/cases - happy to put it into a PR if desired