Skip to content

Commit 19e8b5c

Browse files
committed
Copy OpenAL DLL alongside executable
1 parent c7c925e commit 19e8b5c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ add_executable(CMakeSFMLProject src/main.cpp)
1313
target_link_libraries(CMakeSFMLProject PRIVATE sfml-graphics)
1414
target_compile_features(CMakeSFMLProject PRIVATE cxx_std_17)
1515

16+
if(WIN32)
17+
add_custom_command(
18+
TARGET CMakeSFMLProject
19+
COMMENT "Copy OpenAL DLL"
20+
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$<IF:$<BOOL:${ARCH_64BITS}>,x64,x86>/openal32.dll $<TARGET_FILE_DIR:CMakeSFMLProject>
21+
VERBATIM)
22+
endif()
23+
1624
install(TARGETS CMakeSFMLProject)

0 commit comments

Comments
 (0)