Skip to content

Commit

Permalink
Fix build with newer CMake versions
Browse files Browse the repository at this point in the history
We can no longer refer to targets in subdirectories in the TARGET
property of add_custom_command().
  • Loading branch information
dscharrer committed Feb 15, 2019
1 parent 23a7ca3 commit 977823b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ endif()

add_subdirectory("arx")

add_custom_target(copy-libs ALL)
foreach(prefix IN LISTS CMAKE_PREFIX_PATH)
set(libdir "${prefix}/bin/${CMAKE_LIBRARY_ARCHITECTURE}")
if(IS_DIRECTORY "${libdir}")
file(GLOB libs RELATIVE "${libdir}" *)
foreach(lib IN LISTS libs)
add_custom_command(
TARGET arx POST_BUILD
TARGET copy-libs POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${libdir}/${lib}" "$<TARGET_FILE_DIR:arx>/${lib}"
)
endforeach()
Expand Down

0 comments on commit 977823b

Please sign in to comment.