Skip to content

Commit

Permalink
refactor: can't use system vtk
Browse files Browse the repository at this point in the history
* We can't cleanly override system vtks rpath which will cause lookup issues
  • Loading branch information
Curve committed Apr 18, 2024
1 parent cde9fa9 commit 72fd60a
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions cmake/vtk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,8 @@ macro(setup_vtk_env TARGET OUTPUT)
# built. This is currently the case, and has been the case for prior vtk versions - However we
# should keep an eye on this.

if(TARGET vtksys)
add_custom_command(
TARGET ${TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory $<TARGET_FILE_DIR:vtksys> ${OUTPUT})
else()
add_custom_command(
TARGET ${TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT})

foreach(target ${VTK_LIBRARIES})
get_target_property(target_path ${target} LOCATION)

if(target_path STREQUAL "target_path-NOTFOUND")
continue()
endif()

add_custom_command(
TARGET ${TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t ${OUTPUT} ${target_path})
endforeach()
endif()
add_custom_command(
TARGET ${TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory $<TARGET_FILE_DIR:vtksys> ${OUTPUT})
endmacro()

0 comments on commit 72fd60a

Please sign in to comment.