We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7709937 commit a5b697dCopy full SHA for a5b697d
cmake/OpenSimMacros.cmake
@@ -390,9 +390,15 @@ function(OpenSimAddTests)
390
391
# Copy data files to build directory.
392
foreach(data_file ${OSIMADDTESTS_DATAFILES})
393
- # This command re-copies the data files if they are modified;
394
- # custom commands don't do this.
395
- file(COPY "${data_file}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
+ # This command symlinks the data files
+ # from the source directories into the running directory.
+ # This preserves changes to source files.
396
+ get_filename_component(FILENAME ${data_file} NAME)
397
+ add_custom_command(
398
+ TARGET ${TEST_NAME} POST_BUILD
399
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
400
+ "${data_file}"
401
+ "${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}")
402
endforeach()
403
404
#if(UNIX)
0 commit comments