File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -390,9 +390,15 @@ function(OpenSimAddTests)
390
390
391
391
# Copy data files to build directory.
392
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} " )
393
+ # This command symlinks the data files
394
+ # from the source directories into the running directory.
395
+ # This preserves changes to source files copying.
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
+ $< TARGET_FILE_DIR:${TEST_NAME} > /${FILENAME} )
396
402
endforeach ()
397
403
398
404
#if(UNIX)
You can’t perform that action at this time.
0 commit comments