Skip to content

Commit

Permalink
Copy DLLs to the same directory as the executable that needs them
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher authored and eXpl0it3r committed Jul 18, 2022
1 parent 02f0774 commit d955efc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.21)
project(CMakeSFMLProject LANGUAGES CXX)

include(FetchContent)
Expand All @@ -10,5 +10,9 @@ FetchContent_MakeAvailable(SFML)
add_executable(CMakeSFMLProject src/main.cpp)
target_link_libraries(CMakeSFMLProject PRIVATE sfml-graphics)
target_compile_features(CMakeSFMLProject PRIVATE cxx_std_17)
if (WIN32 AND BUILD_SHARED_LIBS)
add_custom_command(TARGET CMakeSFMLProject POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:CMakeSFMLProject> $<TARGET_FILE_DIR:CMakeSFMLProject> COMMAND_EXPAND_LISTS)
endif()

install(TARGETS CMakeSFMLProject)

0 comments on commit d955efc

Please sign in to comment.