Add note to readme about copying the .dll when using fetchcontent

This commit is contained in:
Jeremy 2023-09-09 18:09:38 -04:00
parent 57031e4c6b
commit 5080fb33d7
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4

View File

@ -45,6 +45,15 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(cpptrace)
target_link_libraries(your_target cpptrace)
if(WIN32) # Copy the .dll on windows
add_custom_command(
TARGET your_target POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:cpptrace>
$<TARGET_FILE_DIR:your_target>
)
endif()
```
It's as easy as that. Cpptrace will automatically configure itself for your system.